245b76ec43
ESLint emitted 17 errors in tests/Frontend/* (production code clean):
- 13× @typescript-eslint/no-explicit-any in axios mock casts
(BulkActionsBar, ProjectsView, projectsStore specs)
- 3× vitest/no-disabled-tests rule-not-found
(eslint-plugin-vitest not registered; inline-disable comments stale)
- 1× @typescript-eslint/no-unused-vars on imported beforeEach
Plus Phase 5 audit finding: TwoFactorView.spec.ts test router was
missing /recovery-use stub → Vue Router warn on every TwoFactorView mount.
Changes:
- BulkActionsBar.spec.ts, ProjectsView.spec.ts, projectsStore.spec.ts:
replace `as any` with `as unknown as ReturnType<typeof vi.fn>` on
axios method mocks; one case used `as unknown as { regionsOpen: bool }`
for vm shape.
- NewProjectDialog.spec.ts, ProjectsView.spec.ts: remove stale
`// eslint-disable-next-line vitest/no-disabled-tests` comments
(it.skip() lines kept).
- ProjectsView.toolbar.spec.ts: drop unused `beforeEach` from import.
- TwoFactorView.spec.ts: add `/recovery-use` route stub.
Verification:
- npx eslint --max-warnings=0 → exit 0 (was 17 errors).
- npx vitest run on affected specs → 24/27 passed + 3 skipped (was same).
- TwoFactorView spec → 3/3 passed, no Vue Router warn.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
31 lines
1.2 KiB
TypeScript
31 lines
1.2 KiB
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import fs from 'node:fs';
|
|
import path from 'node:path';
|
|
|
|
const cssPath = path.resolve(__dirname, '../../resources/css/typography.css');
|
|
const css = fs.existsSync(cssPath) ? fs.readFileSync(cssPath, 'utf-8') : '';
|
|
|
|
describe('typography.css', () => {
|
|
it('imports Inter variable font', () => {
|
|
expect(css).toMatch(/@import\s+url\([^)]*fonts\.googleapis\.com[^)]*Inter[^)]*\)/i);
|
|
});
|
|
|
|
it('imports JetBrains Mono', () => {
|
|
expect(css).toMatch(/@import\s+url\([^)]*fonts\.googleapis\.com[^)]*JetBrains[+\s]?Mono/i);
|
|
});
|
|
|
|
it('sets Inter as default body font with tnum', () => {
|
|
expect(css).toMatch(/font-family:[^;]*['"]?Inter['"]?[^;]*system-ui/);
|
|
expect(css).toMatch(/font-feature-settings:[^;]*['"]?tnum['"]?\s*1/);
|
|
});
|
|
|
|
it('defines .ld-mono utility for JetBrains Mono with tnum', () => {
|
|
expect(css).toMatch(/\.ld-mono\s*{[^}]*font-family:[^;]*['"]?JetBrains Mono['"]?/);
|
|
expect(css).toMatch(/\.ld-mono\s*{[^}]*font-feature-settings:[^;]*['"]?tnum['"]?/);
|
|
});
|
|
|
|
it.each(['ld-label', 'ld-body', 'ld-body-strong', 'ld-h3', 'ld-h2', 'ld-h1'])('defines %s class', (cls) => {
|
|
expect(css).toMatch(new RegExp(`\\.${cls}\\s*{`));
|
|
});
|
|
});
|