release: WRNexusJS 0.5.10
This commit is contained in:
@@ -51,6 +51,48 @@ test("passwordless and passkey components preserve MFA continuation metadata", (
|
||||
expect(signIn).toContain('name="deviceName"');
|
||||
});
|
||||
|
||||
test("recovery forms expose a form slot for CAPTCHA and policy controls", () => {
|
||||
const source = readFileSync(join(directory, "ForgotPassword.wrn"), "utf8");
|
||||
const formStart = source.indexOf("<form");
|
||||
const formEnd = source.indexOf("</form>");
|
||||
const slot = source.indexOf("<slot></slot>");
|
||||
|
||||
expect(formStart).toBeGreaterThanOrEqual(0);
|
||||
expect(slot).toBeGreaterThan(formStart);
|
||||
expect(slot).toBeLessThan(formEnd);
|
||||
});
|
||||
|
||||
test("account forms use the dedicated password components", () => {
|
||||
const signIn = readFileSync(join(directory, "SignIn.wrn"), "utf8");
|
||||
const signUp = readFileSync(join(directory, "SignUp.wrn"), "utf8");
|
||||
|
||||
expect(signIn).toContain("<TogglePassword");
|
||||
expect(signIn).not.toContain('id="auth-sign-in-password"');
|
||||
expect(signUp).toContain("<StrongPassword");
|
||||
expect(signUp).not.toContain('id="auth-sign-up-password"');
|
||||
});
|
||||
|
||||
test("authentication journeys use themed UI form controls", () => {
|
||||
const expected = {
|
||||
"SignIn.wrn": ["<Input", "<TogglePassword", "<Checkbox", "<Button"],
|
||||
"SignUp.wrn": ["<Input", "<StrongPassword", "<Checkbox", "<Button"],
|
||||
"ForgotPassword.wrn": ["<Input", "<Button"],
|
||||
"ResetPassword.wrn": ["<StrongPassword", "<Button"],
|
||||
"MagicLinkSignIn.wrn": ["<Input", "<Button"],
|
||||
"InvitationAccept.wrn": ["<Input", "<StrongPassword", "<Button"],
|
||||
"OtpSignIn.wrn": ["<Input", "<PinInput", "<Button"],
|
||||
"TwoFactorChallenge.wrn": ["<Select", "<PinInput", "<Button"],
|
||||
"AuthenticatorSetup.wrn": ["<Input", "<PinInput", "<Button"],
|
||||
"VerifyEmail.wrn": ["<Input", "<Button"],
|
||||
"VerifyPhone.wrn": ["<PinInput", "<Button"],
|
||||
};
|
||||
|
||||
for (const [file, controls] of Object.entries(expected)) {
|
||||
const source = readFileSync(join(directory, file), "utf8");
|
||||
for (const control of controls) expect(source).toContain(control);
|
||||
}
|
||||
});
|
||||
|
||||
test("verification components can resend without application-owned schema files", () => {
|
||||
const email = readFileSync(join(directory, "VerifyEmail.wrn"), "utf8");
|
||||
const phone = readFileSync(join(directory, "VerifyPhone.wrn"), "utf8");
|
||||
|
||||
Reference in New Issue
Block a user