feat(KAN-21): rebuild login verification and two-factor flows
This commit is contained in:
@@ -69,6 +69,12 @@ try {
|
||||
const { default: InputError } = await server.ssrLoadModule(
|
||||
'/resources/js/components/InputError.vue',
|
||||
);
|
||||
const { default: AuthFormFeedback } = await server.ssrLoadModule(
|
||||
'/resources/js/components/AuthFormFeedback.vue',
|
||||
);
|
||||
const { default: PasswordInput } = await server.ssrLoadModule(
|
||||
'/resources/js/components/PasswordInput.vue',
|
||||
);
|
||||
const localization = createLocalization(
|
||||
{ locale: 'de' },
|
||||
{
|
||||
@@ -76,6 +82,8 @@ try {
|
||||
...en,
|
||||
'common.retry': 'Erneut versuchen',
|
||||
'feedback.empty': 'Noch keine Einträge',
|
||||
'auth.feedback.expiredTitle': 'Sitzung abgelaufen',
|
||||
'auth.password.show': 'Passwort anzeigen',
|
||||
},
|
||||
},
|
||||
);
|
||||
@@ -123,6 +131,40 @@ try {
|
||||
assert.match(fieldError, /role="alert"/);
|
||||
assert.match(fieldError, /text-destructive/);
|
||||
assert.doesNotMatch(fieldError, /<script>/);
|
||||
const expired = await render(AuthFormFeedback, {
|
||||
state: 'server',
|
||||
responseStatus: 419,
|
||||
});
|
||||
assert.match(expired, /Sitzung abgelaufen/);
|
||||
assert.match(expired, /href="\/login"/);
|
||||
assert.doesNotMatch(expired, /Erneut versuchen/);
|
||||
assert.match(
|
||||
await render(AuthFormFeedback, {
|
||||
state: 'server',
|
||||
responseStatus: 429,
|
||||
}),
|
||||
/Too many attempts/,
|
||||
);
|
||||
assert.match(
|
||||
await render(AuthFormFeedback, {
|
||||
state: 'loading',
|
||||
loadingTitle: 'Signing in',
|
||||
}),
|
||||
/Signing in/,
|
||||
);
|
||||
assert.match(
|
||||
await render(AuthFormFeedback, { state: 'validation' }),
|
||||
/Check your details/,
|
||||
);
|
||||
const password = await render(PasswordInput, {
|
||||
disabled: true,
|
||||
autocomplete: 'current-password',
|
||||
});
|
||||
assert.match(password, /Passwort anzeigen/);
|
||||
assert.match(password, /autocomplete="current-password"/);
|
||||
assert.match(password, /aria-pressed="false"/);
|
||||
assert.doesNotMatch(password, /tabindex="-1"/);
|
||||
assert.match(password, /<button[^>]*disabled/);
|
||||
console.log('Form feedback behavior checks passed.');
|
||||
} finally {
|
||||
await server.close();
|
||||
|
||||
Reference in New Issue
Block a user