Files
speaking-practice/tests/auth-ui-helpers.test.mjs
T
TTlaji 2d3ff21222
Deploy Speaking Practice / deploy (push) Successful in 24s
feat: add activation-code auth
2026-06-05 16:56:30 +08:00

10 lines
422 B
JavaScript

import assert from "node:assert/strict";
import authHelpers from "../auth.js";
const { getLoginUrlForPath, shouldShowAdminEntry } = authHelpers;
assert.equal(getLoginUrlForPath("/study.html?video=2"), "./login.html?next=%2Fstudy.html%3Fvideo%3D2");
assert.equal(shouldShowAdminEntry({ role: "admin" }), true);
assert.equal(shouldShowAdminEntry({ role: "user" }), false);
assert.equal(shouldShowAdminEntry(null), false);