- Add 'Twilight Velvet' color palette to globals.css with OKLCH values - Update SettingsPage headers, cards, and dialogs to use semantic theme variables - Update HistoryCard, HistoryFeed, and DraftContent to support dark mode - Update ProviderSelector and ProviderList to use custom card background (#2A2A3D) - Add ThemeToggle component with improved visibility - Ensure consistent use of 'bg-card', 'text-foreground', and 'text-muted-foreground'
39 lines
1.4 KiB
TypeScript
39 lines
1.4 KiB
TypeScript
import { test as base, BrowserContext } from '@playwright/test';
|
|
import { UserFactory } from '../factories/user.factory';
|
|
|
|
type TestFixtures = {
|
|
userFactory: UserFactory;
|
|
offlineControl: {
|
|
goOffline: (context: BrowserContext) => Promise<void>;
|
|
goOnline: (context: BrowserContext) => Promise<void>;
|
|
};
|
|
};
|
|
|
|
export const test = base.extend<TestFixtures>({
|
|
userFactory: async ({ }, use) => {
|
|
const factory = new UserFactory();
|
|
await use(factory);
|
|
await factory.cleanup();
|
|
},
|
|
offlineControl: async ({ }, use) => {
|
|
const offlineFixture = {
|
|
goOffline: async (context: BrowserContext) => {
|
|
await context.setOffline(true);
|
|
for (const page of context.pages()) {
|
|
// Dispatch event to simulate navigator.onLine behavior changes in app
|
|
await page.evaluate(() => window.dispatchEvent(new Event('offline'))).catch(() => { });
|
|
}
|
|
},
|
|
goOnline: async (context: BrowserContext) => {
|
|
await context.setOffline(false);
|
|
for (const page of context.pages()) {
|
|
await page.evaluate(() => window.dispatchEvent(new Event('online'))).catch(() => { });
|
|
}
|
|
},
|
|
};
|
|
await use(offlineFixture);
|
|
},
|
|
});
|
|
|
|
export { expect } from '@playwright/test';
|