test: additional test for ensuring handle:uid is continually set even after re-assertion

This commit is contained in:
Julian Lam
2025-04-01 14:02:16 -04:00
parent c4690392cd
commit 39fc9bae89

View File

@@ -175,6 +175,29 @@ describe('Actor asserton', () => {
})
});
describe('less happy paths', () => {
describe('actor with `preferredUsername` that is not all lowercase', () => {
it('should save a handle-to-uid association', async () => {
const preferredUsername = 'nameWITHCAPS';
const { id } = helpers.mocks.person({ preferredUsername });
await activitypub.actors.assert([id]);
const uid = await db.getObjectField('handle:uid', `${preferredUsername.toLowerCase()}@example.org`);
assert.strictEqual(uid, id);
});
it('should preserve that association when re-asserted', async () => {
const preferredUsername = 'nameWITHCAPS';
const { id } = helpers.mocks.person({ preferredUsername });
await activitypub.actors.assert([id]);
await activitypub.actors.assert([id], { update: true });
const uid = await db.getObjectField('handle:uid', `${preferredUsername.toLowerCase()}@example.org`);
assert.strictEqual(uid, id);
})
});
});
describe('edge cases: loopback handles and uris', () => {
let uid;
const userslug = utils.generateUUID().slice(0, 8);
@@ -335,7 +358,7 @@ describe('as:Group', () => {
assert.strictEqual(activity.object, cid);
});
it.only('should not show up in the user\'s following list', async () => {
it('should not show up in the user\'s following list', async () => {
await user.setCategoryWatchState(uid, cid, categories.watchStates.watching);
// Trigger inbox accept