upgrade to tamagui v2 and guest pwa overhaul

This commit is contained in:
Codex Agent
2026-02-02 13:01:20 +01:00
parent 2e78f3ab8d
commit 7c6e14ffe2
168 changed files with 47462 additions and 8914 deletions

View File

@@ -48,6 +48,37 @@ vi.mock('@/components/ui/collapsible', () => ({
CollapsibleTrigger: ({ children }: { children: React.ReactNode }) => <div>{children}</div>,
}));
vi.mock('@/components/ui/tabs', () => {
const TabsContext = React.createContext<{ value: string; setValue: (value: string) => void }>({
value: '',
setValue: () => {},
});
return {
Tabs: ({ value, onValueChange, children }: { value: string; onValueChange: (value: string) => void; children: React.ReactNode }) => (
<TabsContext.Provider value={{ value, setValue: onValueChange }}>
<div>{children}</div>
</TabsContext.Provider>
),
TabsList: ({ children }: { children: React.ReactNode }) => <div>{children}</div>,
TabsTrigger: ({ value, children }: { value: string; children: React.ReactNode }) => {
const { setValue } = React.useContext(TabsContext);
return (
<button type="button" onClick={() => setValue(value)}>
{children}
</button>
);
},
TabsContent: ({ value, children }: { value: string; children: React.ReactNode }) => {
const { value: activeValue } = React.useContext(TabsContext);
if (activeValue !== value) {
return null;
}
return <div>{children}</div>;
},
};
});
vi.mock('@/lib/utils', () => ({
cn: (...args: Array<string | boolean | undefined>) => args.filter(Boolean).join(' '),
}));
@@ -81,12 +112,15 @@ describe('AuthStep OAuth controls', () => {
it('hides the OAuth buttons when switching to login mode', () => {
render(<AuthStep privacyHtml="" />);
expect(screen.getByText('checkout.auth_step.continue_with_google')).toBeInTheDocument();
expect(screen.getByText('checkout.auth_step.continue_with_facebook')).toBeInTheDocument();
const googleButton = screen.getByText('checkout.auth_step.continue_with_google');
const facebookButton = screen.getByText('checkout.auth_step.continue_with_facebook');
expect(googleButton).toBeInTheDocument();
expect(facebookButton).toBeInTheDocument();
fireEvent.click(screen.getByText('checkout.auth_step.switch_to_login'));
expect(screen.queryByText('checkout.auth_step.continue_with_google')).not.toBeInTheDocument();
expect(screen.queryByText('checkout.auth_step.continue_with_facebook')).not.toBeInTheDocument();
expect(googleButton).not.toBeVisible();
expect(facebookButton).not.toBeVisible();
});
});