chore: apply prettier on the entire project

This commit is contained in:
jubnl
2026-05-25 21:59:42 +02:00
parent c130ed41be
commit 6bcdfbc34b
488 changed files with 82986 additions and 45830 deletions
@@ -1,7 +1,8 @@
import { describe, it, expect } from 'vitest';
import { evaluate } from '../../../src/systemNotices/conditions.js';
import type { SystemNotice } from '../../../src/systemNotices/types.js';
import { describe, it, expect } from 'vitest';
const baseNotice: SystemNotice = {
id: 'test',
display: 'modal',
@@ -50,7 +51,10 @@ describe('existingUserBeforeVersion', () => {
describe('dateWindow', () => {
it('passes when now is inside window', () => {
const notice = { ...baseNotice, conditions: [{ kind: 'dateWindow' as const, startsAt: '2026-05-01T00:00:00Z', endsAt: '2026-07-01T00:00:00Z' }] };
const notice = {
...baseNotice,
conditions: [{ kind: 'dateWindow' as const, startsAt: '2026-05-01T00:00:00Z', endsAt: '2026-07-01T00:00:00Z' }],
};
expect(evaluate(notice, baseCtx)).toBe(true);
});
it('fails when now is before start', () => {
@@ -76,10 +80,10 @@ describe('role', () => {
describe('AND logic', () => {
it('requires all conditions to pass', () => {
const notice = { ...baseNotice, conditions: [
{ kind: 'firstLogin' as const },
{ kind: 'role' as const, roles: ['user'] },
]};
const notice = {
...baseNotice,
conditions: [{ kind: 'firstLogin' as const }, { kind: 'role' as const, roles: ['user'] }],
};
// login_count=1 passes firstLogin, role=user passes role → true
expect(evaluate(notice, { ...baseCtx, user: { ...baseCtx.user, login_count: 1 } })).toBe(true);
// login_count=2 fails firstLogin → false