What changed:
- Onboarding tracking: admin_app_opened on first authenticated dashboard load; event_created, branding_configured,
and invite_created on their respective actions.
- Tour replay: Settings now has an “Experience” section to replay the tour (clears tour seen flag and opens via ?tour=1).
- Empty states: Tasks, Members, and Guest Messages now include richer copy + quick actions.
- New helpers + copy: Tour storage helpers, new translations, and related UI wiring.
43 lines
1.7 KiB
TypeScript
43 lines
1.7 KiB
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { resolveInstallBannerState, shouldShowInstallBanner } from './installBanner';
|
|
|
|
describe('resolveInstallBannerState', () => {
|
|
it('returns null when already installed', () => {
|
|
expect(resolveInstallBannerState({ isInstalled: true, isStandalone: false, canInstall: true, isIos: true })).toBeNull();
|
|
});
|
|
|
|
it('returns null when running in standalone mode', () => {
|
|
expect(resolveInstallBannerState({ isInstalled: false, isStandalone: true, canInstall: true, isIos: true })).toBeNull();
|
|
});
|
|
|
|
it('returns prompt when install prompt is available', () => {
|
|
expect(resolveInstallBannerState({ isInstalled: false, isStandalone: false, canInstall: true, isIos: false })).toEqual({ variant: 'prompt' });
|
|
});
|
|
|
|
it('returns ios when on iOS without prompt', () => {
|
|
expect(resolveInstallBannerState({ isInstalled: false, isStandalone: false, canInstall: false, isIos: true })).toEqual({ variant: 'ios' });
|
|
});
|
|
|
|
it('returns null when no install option exists', () => {
|
|
expect(resolveInstallBannerState({ isInstalled: false, isStandalone: false, canInstall: false, isIos: false })).toBeNull();
|
|
});
|
|
});
|
|
|
|
describe('shouldShowInstallBanner', () => {
|
|
it('returns null when dismissed', () => {
|
|
const result = shouldShowInstallBanner(
|
|
{ isInstalled: false, isStandalone: false, canInstall: true, isIos: true },
|
|
true,
|
|
);
|
|
expect(result).toBeNull();
|
|
});
|
|
|
|
it('returns state when not dismissed', () => {
|
|
const result = shouldShowInstallBanner(
|
|
{ isInstalled: false, isStandalone: false, canInstall: true, isIos: false },
|
|
false,
|
|
);
|
|
expect(result).toEqual({ variant: 'prompt' });
|
|
});
|
|
});
|