feat(navigation): add prominent validation quickstart action
This commit is contained in:
parent
0bbcaba211
commit
9c6b184e39
28614 changed files with 4356173 additions and 23 deletions
|
|
@ -0,0 +1,27 @@
|
|||
import assert from "node:assert/strict";
|
||||
import fs from "node:fs";
|
||||
import test from "node:test";
|
||||
import path from "node:path";
|
||||
|
||||
const sourcePath = path.resolve("components/app-shell.tsx");
|
||||
const source = fs.readFileSync(sourcePath, "utf8");
|
||||
|
||||
test("quickstart action is present in desktop and mobile navigation", () => {
|
||||
assert.match(source, /const QUICKSTART_HREF = "\/validations\/quick-start"/);
|
||||
assert.match(source, /Neue Validierung starten/);
|
||||
assert.match(source, /lg:hidden/);
|
||||
assert.match(source, /lg:block/);
|
||||
assert.match(source, /ClipboardPlus/);
|
||||
});
|
||||
|
||||
test("quickstart action is restricted to roles that may start validations", () => {
|
||||
assert.match(source, /const quickstartRoles = \["admin", "pruefer", "mitarbeiter"\]/);
|
||||
assert.match(source, /canStartValidation\(auth\.user\?\.role\)/);
|
||||
});
|
||||
|
||||
test("quickstart route has its own active state and does not activate validations item", () => {
|
||||
assert.match(source, /pathname === QUICKSTART_HREF/);
|
||||
assert.match(source, /pathname !== QUICKSTART_HREF/);
|
||||
assert.match(source, /aria-current=\{quickstartActive \? "page" : undefined\}/);
|
||||
assert.match(source, /aria-current=\{active \? "page" : undefined\}/);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue