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.
61 lines
1.9 KiB
TypeScript
61 lines
1.9 KiB
TypeScript
import React from 'react';
|
|
import { describe, expect, it, vi } from 'vitest';
|
|
import { render, screen } from '@testing-library/react';
|
|
|
|
vi.mock('@tamagui/core', () => ({
|
|
useTheme: () => ({
|
|
color12: { val: '#111827' },
|
|
color: { val: '#111827' },
|
|
gray11: { val: '#6b7280' },
|
|
gray6: { val: '#e5e7eb' },
|
|
gray2: { val: '#f8fafc' },
|
|
blue3: { val: '#dbeafe' },
|
|
primary: { val: '#2563eb' },
|
|
}),
|
|
}));
|
|
|
|
vi.mock('@tamagui/stacks', () => ({
|
|
YStack: ({ children, ...props }: { children: React.ReactNode }) => <div {...props}>{children}</div>,
|
|
XStack: ({ children, ...props }: { children: React.ReactNode }) => <div {...props}>{children}</div>,
|
|
}));
|
|
|
|
vi.mock('@tamagui/text', () => ({
|
|
SizableText: ({ children, ...props }: { children: React.ReactNode }) => <span {...props}>{children}</span>,
|
|
}));
|
|
|
|
vi.mock('@tamagui/react-native-web-lite', () => ({
|
|
Pressable: ({ children, ...props }: { children: React.ReactNode }) => <button {...props}>{children}</button>,
|
|
}));
|
|
|
|
import { MobileInstallBanner } from './MobileInstallBanner';
|
|
|
|
describe('MobileInstallBanner', () => {
|
|
it('renders install action for prompt variant', () => {
|
|
render(
|
|
<MobileInstallBanner
|
|
state={{ variant: 'prompt' }}
|
|
density="compact"
|
|
onInstall={() => {}}
|
|
onDismiss={() => {}}
|
|
/>,
|
|
);
|
|
|
|
expect(screen.getByText('installBanner.title')).toBeInTheDocument();
|
|
expect(screen.getByText('installBanner.action')).toBeInTheDocument();
|
|
expect(screen.getByLabelText('actions.dismiss')).toBeInTheDocument();
|
|
});
|
|
|
|
it('renders iOS hint without install action', () => {
|
|
render(
|
|
<MobileInstallBanner
|
|
state={{ variant: 'ios' }}
|
|
density="default"
|
|
onDismiss={() => {}}
|
|
/>,
|
|
);
|
|
|
|
expect(screen.getByText('installBanner.iosHint')).toBeInTheDocument();
|
|
expect(screen.queryByText('installBanner.action')).toBeNull();
|
|
});
|
|
});
|