basic tempate of web

This commit is contained in:
2026-06-19 23:55:39 -07:00
parent cef6b487cd
commit 118472945f
172 changed files with 15878 additions and 0 deletions
@@ -0,0 +1,41 @@
import { type RouteLocationNormalized } from "vue-router"
import authorizationGuard from "@/utils/authorization-guards/authorization-guard"
describe("web/src/utils/authorization-guards/authorization-guard.ts", () => {
describe("authorizationGuard", () => {
test("when there are no guards, returns true", async () => {
const to = {
meta: {},
} as unknown as RouteLocationNormalized
const result = await authorizationGuard(to)
expect(result).toBe(true)
})
test("when all guards return true, returns true", async () => {
const to = {
meta: {
guards: [() => true, () => true, () => true],
},
} as unknown as RouteLocationNormalized
const result = await authorizationGuard(to)
expect(result).toBe(true)
})
test("when any guard returns false, returns false", async () => {
const to = {
meta: {
guards: [() => true, () => false, () => true],
},
} as unknown as RouteLocationNormalized
const result = await authorizationGuard(to)
expect(result).toBe(false)
})
})
})