Update editor, workspace, Git services, appearance, and project guides
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import { test } from 'node:test';
|
||||
import { parseAppearance, normalizeAppearance, THEMES } from '../src/lib/theme/appearance.ts';
|
||||
|
||||
test('Removed palettes preserve the saved mode with the default palette', () => {
|
||||
for (const theme of ['gpt', 'terminal', 'unknown']) {
|
||||
for (const mode of ['light', 'dark'] as const) {
|
||||
assert.deepEqual(parseAppearance(JSON.stringify({ theme, mode })), { theme: 'default', mode });
|
||||
}
|
||||
}
|
||||
assert.deepEqual(THEMES, ['default', 'claude', 'sakura']);
|
||||
});
|
||||
test('Sakura cannot restore or save a dark appearance', () => {
|
||||
assert.deepEqual(parseAppearance('{"theme":"sakura","mode":"dark"}'), { theme: 'sakura', mode: 'light' });
|
||||
assert.deepEqual(normalizeAppearance({ theme: 'sakura', mode: 'dark' }), { theme: 'sakura', mode: 'light' });
|
||||
});
|
||||
test('Malformed storage returns a valid default appearance', () => {
|
||||
for (const raw of [null, '', '{', 'null', '42', '[]']) {
|
||||
assert.deepEqual(parseAppearance(raw), { theme: 'default', mode: 'dark' });
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user