Adjust branding defaults and tenant presets
This commit is contained in:
@@ -11,6 +11,9 @@ vi.mock('../hooks/useBackNavigation', () => ({
|
||||
vi.mock('../../api', () => ({
|
||||
fetchTenantProfile: vi.fn(),
|
||||
updateTenantProfile: vi.fn(),
|
||||
getTenantPackagesOverview: vi.fn(),
|
||||
getTenantSettings: vi.fn(),
|
||||
updateTenantSettings: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock('react-hot-toast', () => ({
|
||||
@@ -47,6 +50,7 @@ vi.mock('../components/FormControls', () => ({
|
||||
MobileInput: ({ hasError, compact, ...props }: React.InputHTMLAttributes<HTMLInputElement> & { hasError?: boolean; compact?: boolean }) => (
|
||||
<input {...props} />
|
||||
),
|
||||
MobileColorInput: (props: React.InputHTMLAttributes<HTMLInputElement>) => <input {...props} />,
|
||||
MobileSelect: ({ children, ...props }: { children: React.ReactNode }) => <select {...props}>{children}</select>,
|
||||
}));
|
||||
|
||||
@@ -59,6 +63,14 @@ vi.mock('@tamagui/text', () => ({
|
||||
SizableText: ({ children }: { children: React.ReactNode }) => <span>{children}</span>,
|
||||
}));
|
||||
|
||||
vi.mock('@tamagui/react-native-web-lite', () => ({
|
||||
Pressable: ({ children, ...props }: { children: React.ReactNode } & React.ButtonHTMLAttributes<HTMLButtonElement>) => (
|
||||
<button type="button" {...props}>
|
||||
{children}
|
||||
</button>
|
||||
),
|
||||
}));
|
||||
|
||||
vi.mock('../theme', () => ({
|
||||
useAdminTheme: () => ({
|
||||
text: '#111827',
|
||||
@@ -77,7 +89,7 @@ vi.mock('../theme', () => ({
|
||||
}),
|
||||
}));
|
||||
|
||||
import { fetchTenantProfile, updateTenantProfile } from '../../api';
|
||||
import { fetchTenantProfile, updateTenantProfile, getTenantPackagesOverview, getTenantSettings } from '../../api';
|
||||
import MobileProfileAccountPage from '../ProfileAccountPage';
|
||||
|
||||
const profileFixture = {
|
||||
@@ -90,6 +102,14 @@ const profileFixture = {
|
||||
};
|
||||
|
||||
describe('MobileProfileAccountPage', () => {
|
||||
beforeEach(() => {
|
||||
vi.mocked(getTenantPackagesOverview).mockResolvedValue({
|
||||
packages: [],
|
||||
activePackage: { branding_allowed: false },
|
||||
});
|
||||
vi.mocked(getTenantSettings).mockResolvedValue({ id: 1, settings: {}, updated_at: null });
|
||||
});
|
||||
|
||||
it('submits account updates with name, email, and locale', async () => {
|
||||
vi.mocked(fetchTenantProfile).mockResolvedValue(profileFixture);
|
||||
vi.mocked(updateTenantProfile).mockResolvedValue(profileFixture);
|
||||
|
||||
Reference in New Issue
Block a user