mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-10-31 16:13:15 +00:00
test: seed nora's signature details for the organisation signature
This commit is contained in:
@@ -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: '',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user