feat(ui): implement 'Twilight Velvet' dark theme and fix visibility issues
- 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'
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
import { faker } from '@faker-js/faker';
|
||||
|
||||
/**
|
||||
* UserFactory
|
||||
*
|
||||
* Handles creation and cleanup of test users.
|
||||
* Note: Since this is a local-first app without a real backend API for user creation yet,
|
||||
* this factory currently generates mock data. adapting to real API calls later.
|
||||
*/
|
||||
export class UserFactory {
|
||||
// In a real app, we would track IDs here for cleanup
|
||||
// private createdUserIds: string[] = [];
|
||||
|
||||
async createUser(overrides = {}) {
|
||||
const user = {
|
||||
id: faker.string.uuid(),
|
||||
email: faker.internet.email(),
|
||||
name: faker.person.fullName(),
|
||||
password: faker.internet.password(),
|
||||
createdAt: new Date().toISOString(),
|
||||
...overrides,
|
||||
};
|
||||
|
||||
// Placeholder: In a real app, you would POST to API here
|
||||
// const response = await fetch(\`\${process.env.API_URL}/users\`, ...);
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
async cleanup() {
|
||||
// Placeholder: In a real app, you would DELETE users here
|
||||
// for (const id of this.createdUserIds) { ... }
|
||||
|
||||
// For now, no cleanup needed for transient mock data
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,12 @@
|
||||
import { test as base } from '@playwright/test';
|
||||
import { UserFactory } from './factories/user-factory';
|
||||
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>({
|
||||
@@ -11,6 +15,24 @@ export const test = base.extend<TestFixtures>({
|
||||
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';
|
||||
|
||||
Reference in New Issue
Block a user