mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-14 08:11:03 +00:00
fix(wanderer): say so when wanderer names no author for the token's account
A token whose account has no local ActivityPub author was reported as invalid_response, which the settings show as 'The answer did not come from wanderer', although wanderer had answered fine. It now has its own code, no_author, with a message in every language that says what is missing.
This commit is contained in:
@@ -131,14 +131,17 @@ describe('WandererClient', () => {
|
||||
expect((await failure(() => client.check(CREDS))).code).toBe('unauthorized');
|
||||
});
|
||||
|
||||
it('RS-03: an owner without a local author, or with an odd id, is an answer TREK does not trust', async () => {
|
||||
it('RS-03: an owner without a local author is told as such; an odd id is an answer TREK does not trust', async () => {
|
||||
answer({
|
||||
...OWNER,
|
||||
'/api/v1/user/gixauk8ukjpqabm': reply({
|
||||
expand: { activitypub_actors_via_user: [{ id: 'remote1', is_local: false }] },
|
||||
}),
|
||||
});
|
||||
expect((await failure(() => client.ownActors(CREDS))).code).toBe('invalid_response');
|
||||
// wanderer did answer, so the reason is the missing author, not an answer from somewhere else.
|
||||
expect((await failure(() => client.ownActors(CREDS))).code).toBe('no_author');
|
||||
answer({ ...OWNER, '/api/v1/user/gixauk8ukjpqabm': reply({}) });
|
||||
expect((await failure(() => client.ownActors(CREDS))).code).toBe('no_author');
|
||||
|
||||
answer({ '/api/v1/api-token': reply({ items: [{ user: 'Not-An-Id!' }] }) });
|
||||
expect((await failure(() => client.ownActors(CREDS))).code).toBe('invalid_response');
|
||||
|
||||
Reference in New Issue
Block a user