Makelore 2.0 initial clean snapshot
This commit is contained in:
40
tests/unit/light-visual-system.test.ts
Normal file
40
tests/unit/light-visual-system.test.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
const srcRoot = join(process.cwd(), 'src');
|
||||
|
||||
function readSource(relativePath: string): string {
|
||||
return readFileSync(join(srcRoot, relativePath), 'utf8');
|
||||
}
|
||||
|
||||
describe('light visual system', () => {
|
||||
it('removes the user-facing theme switch from settings', () => {
|
||||
const settingsSource = readSource('pages/Settings/index.tsx');
|
||||
|
||||
expect(settingsSource).not.toMatch(/themeOptions/);
|
||||
expect(settingsSource).not.toMatch(/appearance\.theme/);
|
||||
expect(settingsSource).not.toMatch(/setTheme/);
|
||||
});
|
||||
|
||||
it('keeps the app shell in light mode instead of following system dark mode', () => {
|
||||
const appSource = readSource('App.tsx');
|
||||
|
||||
expect(appSource).toMatch(/root\.classList\.add\('light'\)/);
|
||||
expect(appSource).not.toMatch(/prefers-color-scheme: dark/);
|
||||
expect(appSource).not.toMatch(/root\.classList\.add\(theme\)/);
|
||||
expect(appSource).not.toMatch(/root\.classList\.add\(systemTheme\)/);
|
||||
});
|
||||
|
||||
it('does not use the old dark navy NITU shell backgrounds', () => {
|
||||
const shellSource = [
|
||||
readSource('components/layout/Sidebar.tsx'),
|
||||
readSource('pages/Chat/OpencodeChatPanel.tsx'),
|
||||
readSource('pages/NiTu/index.tsx'),
|
||||
].join('\n');
|
||||
|
||||
expect(shellSource).not.toMatch(
|
||||
/bg-\[#(?:0f1220|101322|11131f|141727|171522|192033|211d31|2b2b31)\]/i,
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user