This commit is contained in:
tamaina 2025-08-30 19:54:51 +09:00
parent 5c2dbd8d63
commit a79b2f0dc8
2 changed files with 11 additions and 6 deletions

View File

@ -36,10 +36,15 @@ describe('API ap/show', () => {
strictEqual(res.object.id, alice.id);
});
test('resolve a remote user by local profile URL (https://a.test/@bob@b.test)', async () => {
const res = await alice.client.request('ap/show', { uri: `https://a.test/@${bob.username}@b.test` });
strictEqual(res.type, 'User');
strictEqual(res.object.uri, `https://b.test/users/${bob.id}`);
test('throws in resolving a remote user by local profile URL (https://a.test/@bob@b.test)', async () => {
await rejects(
async () => await alice.client.request('ap/show', { uri: `https://a.test/@${bob.username}@b.test` }),
(err: any) => {
strictEqual(err.code, 'NO_SUCH_OBJECT');
strictEqual(err.info.e.message, 'No such object.');
return true;
},
);
});
});

View File

@ -516,7 +516,7 @@ describe('User', () => {
await rejects(
async () => await resolveRemoteUser('a.test', alice.id, bob),
(err: any) => {
strictEqual(err.code, 'SOMETHING_HAPPENED_IN_FETCHING_URI');
strictEqual(err.code, 'INTERNAL_ERROR');
return true;
},
);
@ -551,7 +551,7 @@ describe('User', () => {
await rejects(
async () => await resolveRemoteUser('a.test', alice.id, bob),
(err: any) => {
strictEqual(err.code, 'SOMETHING_HAPPENED_IN_FETCHING_URI');
strictEqual(err.code, 'INTERNAL_ERROR');
return true;
},
);