Files
WRNexusJS/packages/auth/test/package-components.test.ts
Clintchiz 586a6db8ff
Quality / quality (ubuntu-latest) (push) Failing after 21s
Quality / quality (windows-latest) (push) Canceled after 0s
release: WRNexusJS 0.8.0
2026-08-02 23:18:51 +05:30

33 lines
1.0 KiB
TypeScript

import { expect, test } from "bun:test";
import { readdirSync, readFileSync } from "node:fs";
import { join } from "node:path";
import { parse } from "@wrnexus/syntax";
const componentsDir = join(import.meta.dir, "..", "components");
test("all auth package components parse", () => {
for (const file of readdirSync(componentsDir).filter((name) => name.endsWith(".wrn"))) {
expect(() => parse(readFileSync(join(componentsDir, file), "utf8"))).not.toThrow();
}
});
test("auth form blocks use WRNexus UI controls", () => {
const formFiles = [
"SignIn.wrn",
"SignUp.wrn",
"ForgotPassword.wrn",
"ResetPassword.wrn",
"OtpSignIn.wrn",
"TwoFactorChallenge.wrn",
"VerifyEmail.wrn",
"VerifyPhone.wrn",
"InvitationAccept.wrn",
"MagicLinkSignIn.wrn",
];
for (const file of formFiles) {
const source = readFileSync(join(componentsDir, file), "utf8");
expect(source).toMatch(/<(?:Input|PinInput|StrongPassword|TogglePassword|Checkbox|Select)\b/);
expect(source).toContain("<Button");
}
});