style(mail-ingest): wrap the repository lines the way prettier does

The new repositories and their tests held a few lines past the 120-column print width.
This commit is contained in:
Maurice
2026-11-13 15:39:14 +01:00
parent aa84d71302
commit 5f600cf263
5 changed files with 45 additions and 10 deletions
@@ -62,7 +62,13 @@ describe('MailIngestAddressesRepository', () => {
it('revokes the live address of one scope only, and still finds a revoked token', async () => {
const { user } = await makeUser(t);
const trip = await makeTrip(t, user.id);
const own = await addresses.insertAddress({ userId: user.id, tripId: null, tokenHash: 'a', tokenEnc: 'x', createdAt: AT });
const own = await addresses.insertAddress({
userId: user.id,
tripId: null,
tokenHash: 'a',
tokenEnc: 'x',
createdAt: AT,
});
await addresses.insertAddress({ userId: user.id, tripId: trip.id, tokenHash: 'b', tokenEnc: 'y', createdAt: AT });
expect(await addresses.revokeLive(user.id, null, LATER)).toBe(1);
@@ -77,7 +83,13 @@ describe('MailIngestAddressesRepository', () => {
it('notes when a mail came in', async () => {
const { user } = await makeUser(t);
const id = await addresses.insertAddress({ userId: user.id, tripId: null, tokenHash: 'c', tokenEnc: 'z', createdAt: AT });
const id = await addresses.insertAddress({
userId: user.id,
tripId: null,
tokenHash: 'c',
tokenEnc: 'z',
createdAt: AT,
});
await addresses.touchUsed(id, LATER);
expect((await addresses.findById(id))?.last_used_at).toBe(LATER);
});
@@ -203,7 +203,12 @@ describe('MailIngestCandidatesRepository: what it reads of the trips', () => {
it('reads the person a mail is for', async () => {
const { user } = await makeUser(t, { username: 'mia', email: 'mia@example.com' });
expect(await candidates.findPerson(user.id)).toEqual({ id: user.id, username: 'mia', email: 'mia@example.com', role: 'user' });
expect(await candidates.findPerson(user.id)).toEqual({
id: user.id,
username: 'mia',
email: 'mia@example.com',
role: 'user',
});
expect(await candidates.findPerson(user.id + 100)).toBeNull();
});
@@ -218,8 +223,9 @@ describe('MailIngestCandidatesRepository: what it reads of the trips', () => {
external_id: 'ABC123|flight|2027-03-01|hnd-itm',
});
expect(await candidates.tripHasExternal(trip.id, ['import', 'mail'], 'ABC123|flight|2027-03-01|hnd-itm')).toBe(true);
expect(await candidates.tripHasExternal(trip.id, ['import'], 'ABC123|flight|2027-03-01|hnd-itm')).toBe(false);
const key = 'ABC123|flight|2027-03-01|hnd-itm';
expect(await candidates.tripHasExternal(trip.id, ['import', 'mail'], key)).toBe(true);
expect(await candidates.tripHasExternal(trip.id, ['import'], key)).toBe(false);
const none = { type: 'flight', startFrom: null, startTo: null, confirmation: null };
expect(await candidates.tripHasSimilar(trip.id, none)).toBe(false);
@@ -125,7 +125,12 @@ describe('MailIngestMessagesRepository', () => {
expect(await messages.claimDue(at('2026-11-01T12:00:00Z'), lease, 3)).toEqual([id]);
await messages.finish(id!, DONE);
expect(await messages.findById(id!)).toMatchObject({ status: 'processed', ai_used: 1, from_verified: 1, lease_until: null });
expect(await messages.findById(id!)).toMatchObject({
status: 'processed',
ai_used: 1,
from_verified: 1,
lease_until: null,
});
});
it('purges a mail once it is done and nothing waits on it, and always after the hard limit', async () => {