12 lines
372 B
TypeScript
12 lines
372 B
TypeScript
import { expect, test } from "bun:test";
|
|
import { parse } from "../src/index.ts";
|
|
|
|
test("pages accept concise authentication and permission guards", () => {
|
|
const ast = parse(`page Dashboard {
|
|
auth = true
|
|
permission = "dashboard:read"
|
|
view { <h1>Dashboard</h1> }
|
|
}`);
|
|
expect(ast.security).toEqual({ auth: "required", permission: "dashboard:read" });
|
|
});
|