Files
edentext/tests/unit/chrome-mode.test.ts
Steffen Becker 10b650c64c refactor: the floating island's mode id is 'modern', matching its label
The id said 'classic' while the UI called the ribbon Classic and the
island Modern (beta). Type, i18n keys, comments and docs now agree;
a stored legacy 'classic' still selects the island.
2026-08-17 20:05:15 +02:00

20 lines
689 B
TypeScript

// The chrome default is the ribbon; a stored choice wins, and the floating
// island's legacy stored name 'classic' still selects it.
import { describe, it, expect, beforeEach } from 'vitest';
import { loadChromeMode, saveChromeMode } from '../../src/lib/storage/theme';
describe('chrome mode', () => {
beforeEach(() => localStorage.clear());
it('defaults to the ribbon', () => {
expect(loadChromeMode()).toBe('ribbon');
});
it('keeps a stored choice, the legacy name included', () => {
saveChromeMode('modern');
expect(loadChromeMode()).toBe('modern');
localStorage.setItem('edentext-chrome', 'classic');
expect(loadChromeMode()).toBe('modern');
});
});