fix issue 207 account actions visibility

This commit is contained in:
kuekhaoyang
2026-07-12 01:02:47 +08:00
parent d6f2a2e3c7
commit 7ae08e2d7d
7 changed files with 53 additions and 6 deletions
+27
View File
@@ -0,0 +1,27 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import { join } from 'node:path';
const projectRoot = process.cwd();
test('navbar keeps logout available below the desktop breakpoint', () => {
const source = readFileSync(
join(projectRoot, 'components/layout/Navbar.tsx'),
'utf8',
);
assert.match(source, /\{session && \(\s*<div className="flex items-center gap-1 sm:gap-2">/);
assert.match(source, /<div className="hidden sm:flex[^>]*>[\s\S]*?session\.name/);
assert.doesNotMatch(source, /\{session && \(\s*<div className="hidden sm:flex/);
});
test('premium settings includes the shared account management section', () => {
const source = readFileSync(
join(projectRoot, 'app/premium/settings/page.tsx'),
'utf8',
);
assert.match(source, /import \{ AccountSettings \} from '@\/components\/settings\/AccountSettings';/);
assert.match(source, /<AppVersionSettings \/>[\s\S]*?<AccountSettings \/>/);
});