17 lines
843 B
TypeScript
Executable File
17 lines
843 B
TypeScript
Executable File
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { readFile } from 'node:fs/promises';
|
|
|
|
test('original W branding is restored and shared by favicon and image placeholders', async () => {
|
|
const read = (file: string) => readFile(new URL(`../${file}`, import.meta.url), 'utf8');
|
|
const [html, app, card, icon] = await Promise.all([
|
|
read('index.html'), read('src/App.tsx'), read('src/Card.tsx'), read('public/original-logo.svg'),
|
|
]);
|
|
assert.match(html, /rel="icon" type="image\/svg\+xml" href="\/original-logo.svg"/);
|
|
assert.match(app, /className="brand-mark" aria-hidden="true">W/);
|
|
assert.doesNotMatch(app + card + html, /Wikideck\.png/);
|
|
assert.equal((icon.match(/<svg\b/g) ?? []).length, 1);
|
|
assert.match(icon, /viewBox="0 0 64 64"/);
|
|
assert.match(icon, /fill="#d4f77d"/);
|
|
});
|