From fa13223c69716a2fad5e932bb0761258d7e4a816 Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Sat, 31 Oct 2026 13:21:47 +0100 Subject: [PATCH] test: seed nora's signature details for the organisation signature --- lib/demo/__tests__/fixtures.test.ts | 16 +++++++++++++++- lib/demo/demo-preferences.ts | 5 ++++- lib/demo/fixtures/identities.ts | 13 +++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/lib/demo/__tests__/fixtures.test.ts b/lib/demo/__tests__/fixtures.test.ts index 38e487e2d..a8d80dbca 100644 --- a/lib/demo/__tests__/fixtures.test.ts +++ b/lib/demo/__tests__/fixtures.test.ts @@ -21,7 +21,8 @@ import { getSenderVerification, extractListHeaders } from '@/lib/email-headers'; import { findVerificationCode } from '@/lib/verification-code'; import { findCalendarAttachment } from '@/lib/calendar-invitation'; import { mentionFromLink } from '@/lib/recipient-mentions'; -import { KEYWORD_PALETTE } from '@/stores/settings-store'; +import { KEYWORD_PALETTE, useSettingsStore } from '@/stores/settings-store'; +import { seedDemoPreferences, DEMO_SEED_KEY } from '../demo-preferences'; const PUBLIC = path.resolve(__dirname, '..', '..', '..', 'public'); const work = getDemoData('work'); @@ -321,3 +322,16 @@ describe('demo client: account scope', () => { expect(inbox.every((e) => Object.keys(e.mailboxIds).some((id) => id.startsWith('demo-support-')))).toBe(true); }); }); + +// What the website's audience screenshots show in action +// (local-data/website-audiences-plan.md, section 8). +describe('demo fixtures: audience screenshots', () => { + it('a returning visitor gets Nora\'s details for the organisation signature', () => { + // Seeded with the previous version: the new details must still arrive. + localStorage.setItem(DEMO_SEED_KEY, '2026-10'); + seedDemoPreferences(); + expect(useSettingsStore.getState().signatureDetails).toEqual({ + title: 'Engineering Lead', department: 'Platform', phone: '+49 30 555 0199', mobile: '', + }); + }); +}); diff --git a/lib/demo/demo-preferences.ts b/lib/demo/demo-preferences.ts index 9d0ad8e29..b8012fa85 100644 --- a/lib/demo/demo-preferences.ts +++ b/lib/demo/demo-preferences.ts @@ -3,9 +3,10 @@ import { useTemplateStore } from '@/stores/template-store'; import { usePolicyStore } from '@/stores/policy-store'; import { DEMO_KEYWORDS } from './fixtures/keywords'; import { createDemoTemplates } from './fixtures/templates'; +import { DEMO_SIGNATURE_DETAILS } from './fixtures/identities'; /** Bump when the seeded preferences change, so returning visitors get them. */ -const SEED_VERSION = '2026-10'; +const SEED_VERSION = '2026-11'; export const DEMO_SEED_KEY = 'bulwark-demo-seed'; /** @@ -30,6 +31,8 @@ export function seedDemoPreferences(): void { settings.updateSetting('enableUnifiedMailbox', true); settings.updateSetting('unifiedCrossAccount', true); settings.updateSetting('includeGroupInUnified', true); + // Fills the organisation signature, when an administrator sets one. + settings.updateSetting('signatureDetails', DEMO_SIGNATURE_DETAILS); const templates = useTemplateStore.getState(); if (templates.templates.length === 0) { diff --git a/lib/demo/fixtures/identities.ts b/lib/demo/fixtures/identities.ts index ecbc94bfc..4da562da0 100644 --- a/lib/demo/fixtures/identities.ts +++ b/lib/demo/fixtures/identities.ts @@ -1,6 +1,19 @@ import type { Identity } from '@/lib/jmap/types'; +import type { SignatureDetails } from '@/lib/org-signature'; import { NORA, NORA_ALIAS, SUPPORT } from './people'; +/** + * What Nora filled in under Settings > Account > Your details, for the + * organisation signature an administrator sets (lib/org-signature.ts). + * The same title and phone as her own signature below. + */ +export const DEMO_SIGNATURE_DETAILS: SignatureDetails = { + title: 'Engineering Lead', + department: 'Platform', + phone: '+49 30 555 0199', + mobile: '', +}; + export function createDemoIdentities(): Identity[] { return [ {