mirror of
https://gitlab.com/ArkHost/HelixNotes.git
synced 2026-09-19 09:27:29 +02:00
25 lines
741 B
JavaScript
25 lines
741 B
JavaScript
import assert from 'node:assert/strict';
|
|
import { readFile } from 'node:fs/promises';
|
|
import test from 'node:test';
|
|
|
|
const appLayout = await readFile(
|
|
new URL('../src/lib/components/AppLayout.svelte', import.meta.url),
|
|
'utf8'
|
|
);
|
|
|
|
test('the theme shortcut recognizes a resolved custom dark theme', () => {
|
|
assert.match(
|
|
appLayout,
|
|
/\$customThemes\.find\(theme => theme\.id === \$resolvedTheme\)/
|
|
);
|
|
assert.match(
|
|
appLayout,
|
|
/darkThemes\.includes\(\$resolvedTheme\) \|\| \(customTheme\?\.is_dark \?\? false\)/
|
|
);
|
|
});
|
|
|
|
test('AppLayout leaves root theme application to the root layout', () => {
|
|
assert.doesNotMatch(appLayout, /function applyTheme\(/);
|
|
assert.doesNotMatch(appLayout, /applyTheme\(\$theme\)/);
|
|
});
|