fix: expose payment admin navigation
Deploy staging to test server / deploy (push) Successful in 2m59s
Deploy staging to test server / deploy (push) Successful in 2m59s
This commit is contained in:
@@ -13,6 +13,7 @@ const codesRoute = readFileSync(new URL("../src/app/api/admin/codes/route.ts", i
|
||||
const codeRoute = readFileSync(new URL("../src/app/api/admin/codes/[id]/route.ts", import.meta.url), "utf8");
|
||||
const providers = readFileSync(new URL("../src/lib/admin/providers.ts", import.meta.url), "utf8");
|
||||
const adminLayout = readFileSync(new URL("../src/app/admin/layout.tsx", import.meta.url), "utf8");
|
||||
const adminApp = readFileSync(new URL("../src/components/admin/admin-app.tsx", import.meta.url), "utf8");
|
||||
const adminRootRoute = readFileSync(new URL("../src/app/admin/route.ts", import.meta.url), "utf8");
|
||||
const readonlyRoutes = ["users", "credit-transactions", "consultations", "audit-logs"].map((resource) =>
|
||||
readFileSync(new URL(`../src/app/api/admin/${resource}/route.ts`, import.meta.url), "utf8"),
|
||||
@@ -43,6 +44,13 @@ test("self-hosted account entry checks only the persisted admin role", () => {
|
||||
assert.match(auth, /authorizeAdminAccess\(user, access\)/);
|
||||
});
|
||||
|
||||
test("admin navigation exposes payment records and payment configuration", () => {
|
||||
assert.match(adminApp, /name: "payments", list: "\/admin\/payments", meta: \{ label: "支付记录"/);
|
||||
assert.match(adminApp, /name: "packages", list: "\/admin\/packages", meta: \{ label: "支付配置"/);
|
||||
assert.match(adminApp, /CreditCardOutlined/);
|
||||
assert.match(adminApp, /SettingOutlined/);
|
||||
});
|
||||
|
||||
test("admin pages and root route are server-gated before rendering or redirecting", () => {
|
||||
assert.match(adminLayout, /await requireAdminSession\("read"\)/);
|
||||
assert.match(adminLayout, /error\.status === 401 \? "\/login" : "\/"/);
|
||||
|
||||
Reference in New Issue
Block a user