Skip to content

Commit c525144

Browse files
committed
feat(localizations): Generate all localizations
1 parent c9ec623 commit c525144

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+223
-84
lines changed

packages/clerk-js/src/ui/components/SignIn/__tests__/SignInFactorOne.test.tsx

Lines changed: 78 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,84 @@ describe('SignInFactorOne', () => {
352352
),
353353
).not.toBeInTheDocument();
354354
});
355+
356+
it('using an untrusted password should show the untrusted password screen', async () => {
357+
const { wrapper, fixtures } = await createFixtures(f => {
358+
f.withEmailAddress();
359+
f.withPassword();
360+
f.withPreferredSignInStrategy({ strategy: 'password' });
361+
f.startSignInWithEmailAddress({
362+
supportEmailCode: true,
363+
supportPassword: true,
364+
supportResetPassword: true,
365+
});
366+
});
367+
fixtures.signIn.prepareFirstFactor.mockReturnValueOnce(Promise.resolve({} as SignInResource));
368+
369+
const errJSON = {
370+
code: 'form_password_untrusted',
371+
long_message:
372+
"Your appears to have been compromised or it's no longer trusted and cannot be used. Please use another method to continue.",
373+
message:
374+
"Your appears to have been compromised or it's no longer trusted and cannot be used. Please use another method to continue.",
375+
meta: { param_name: 'password' },
376+
};
377+
378+
fixtures.signIn.attemptFirstFactor.mockRejectedValueOnce(
379+
new ClerkAPIResponseError('Error', {
380+
data: [errJSON],
381+
status: 422,
382+
}),
383+
);
384+
const { userEvent } = render(<SignInFactorOne />, { wrapper });
385+
await userEvent.type(screen.getByLabelText('Password'), '123456');
386+
await userEvent.click(screen.getByText('Continue'));
387+
388+
await screen.findByText('Password compromised');
389+
await screen.findByText(
390+
"Your appears to have been compromised or it's no longer trusted and cannot be used. Please use another method to continue.",
391+
);
392+
393+
await screen.findByText('Email code to [email protected]');
394+
});
395+
396+
it('Prompts the user to use a different method if the password is untrusted', async () => {
397+
const { wrapper, fixtures } = await createFixtures(f => {
398+
f.withEmailAddress();
399+
f.withPassword();
400+
f.withPreferredSignInStrategy({ strategy: 'password' });
401+
f.withSocialProvider({ provider: 'google', authenticatable: true });
402+
f.startSignInWithEmailAddress({
403+
supportEmailCode: true,
404+
supportPassword: true,
405+
supportResetPassword: true,
406+
});
407+
});
408+
fixtures.signIn.prepareFirstFactor.mockReturnValueOnce(Promise.resolve({} as SignInResource));
409+
410+
const errJSON = {
411+
code: 'form_password_untrusted',
412+
long_message:
413+
"Your appears to have been compromised or it's no longer trusted and cannot be used. Please use another method to continue.",
414+
message:
415+
"Your appears to have been compromised or it's no longer trusted and cannot be used. Please use another method to continue.",
416+
meta: { param_name: 'password' },
417+
};
418+
419+
fixtures.signIn.attemptFirstFactor.mockRejectedValueOnce(
420+
new ClerkAPIResponseError('Error', {
421+
data: [errJSON],
422+
status: 422,
423+
}),
424+
);
425+
const { userEvent } = render(<SignInFactorOne />, { wrapper });
426+
await userEvent.type(screen.getByLabelText('Password'), '123456');
427+
await userEvent.click(screen.getByText('Continue'));
428+
429+
await screen.findByText('Password compromised');
430+
await userEvent.click(screen.getByText('Email code to [email protected]'));
431+
await screen.findByText('Check your email');
432+
});
355433
});
356434

357435
describe('Forgot Password', () => {
@@ -1003,87 +1081,4 @@ describe('SignInFactorOne', () => {
10031081
});
10041082
});
10051083
});
1006-
1007-
describe('Password untrusted', () => {
1008-
it('it shows the untrusted password screen if the users password is untrusted', async () => {
1009-
const { wrapper, fixtures } = await createFixtures(f => {
1010-
f.withEmailAddress();
1011-
f.withPassword();
1012-
f.withPreferredSignInStrategy({ strategy: 'password' });
1013-
f.withSocialProvider({ provider: 'google', authenticatable: true });
1014-
f.startSignInWithEmailAddress({
1015-
supportEmailCode: true,
1016-
supportPassword: true,
1017-
supportResetPassword: true,
1018-
});
1019-
});
1020-
fixtures.signIn.prepareFirstFactor.mockReturnValueOnce(Promise.resolve({} as SignInResource));
1021-
1022-
const errJSON = {
1023-
code: 'form_password_untrusted',
1024-
long_message:
1025-
"Your appears to have been compromised or it's no longer trusted and cannot be used. Please use another method to continue.",
1026-
message:
1027-
"Your appears to have been compromised or it's no longer trusted and cannot be used. Please use another method to continue.",
1028-
meta: { param_name: 'password' },
1029-
};
1030-
1031-
fixtures.signIn.attemptFirstFactor.mockRejectedValueOnce(
1032-
new ClerkAPIResponseError('Error', {
1033-
data: [errJSON],
1034-
status: 422,
1035-
}),
1036-
);
1037-
const { userEvent } = render(<SignInFactorOne />, { wrapper });
1038-
await userEvent.type(screen.getByLabelText('Password'), '123456');
1039-
await userEvent.click(screen.getByText('Continue'));
1040-
1041-
await screen.findByText('Password compromised');
1042-
await screen.findByText(
1043-
"Your appears to have been compromised or it's no longer trusted and cannot be used. Please use another method to continue.",
1044-
);
1045-
1046-
await screen.findByText('Email code to [email protected]');
1047-
await screen.findByText('Continue with Google');
1048-
});
1049-
1050-
it('clicking the email code method should prompt the user to verify their email', async () => {
1051-
const { wrapper, fixtures } = await createFixtures(f => {
1052-
f.withEmailAddress();
1053-
f.withPassword();
1054-
f.withPreferredSignInStrategy({ strategy: 'password' });
1055-
f.withSocialProvider({ provider: 'google', authenticatable: true });
1056-
f.startSignInWithEmailAddress({
1057-
supportEmailCode: true,
1058-
supportPassword: true,
1059-
supportResetPassword: true,
1060-
supportEmailLink: true,
1061-
});
1062-
});
1063-
fixtures.signIn.prepareFirstFactor.mockReturnValueOnce(Promise.resolve({} as SignInResource));
1064-
1065-
const errJSON = {
1066-
code: 'form_password_untrusted',
1067-
long_message:
1068-
"Your appears to have been compromised or it's no longer trusted and cannot be used. Please use another method to continue.",
1069-
message:
1070-
"Your appears to have been compromised or it's no longer trusted and cannot be used. Please use another method to continue.",
1071-
meta: { param_name: 'password' },
1072-
};
1073-
1074-
fixtures.signIn.attemptFirstFactor.mockRejectedValueOnce(
1075-
new ClerkAPIResponseError('Error', {
1076-
data: [errJSON],
1077-
status: 422,
1078-
}),
1079-
);
1080-
const { userEvent } = render(<SignInFactorOne />, { wrapper });
1081-
await userEvent.type(screen.getByLabelText('Password'), '123456');
1082-
await userEvent.click(screen.getByText('Continue'));
1083-
1084-
await screen.findByText('Password compromised');
1085-
await userEvent.click(screen.getByText('Email code to [email protected]'));
1086-
await screen.findByText('Check your email');
1087-
});
1088-
});
10891084
});

packages/localizations/src/ar-SA.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,9 @@ export const arSA: LocalizationResource = {
693693
passwordPwned: {
694694
title: 'كلمة المرور غير آمنة',
695695
},
696+
passwordUntrusted: {
697+
title: undefined,
698+
},
696699
phoneCode: {
697700
formTitle: 'رمز التحقق',
698701
resendButton: 'لم يصلك الرمز؟ حاول مرة أخرى',

packages/localizations/src/be-BY.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,9 @@ export const beBY: LocalizationResource = {
700700
passwordPwned: {
701701
title: 'Пароль быў узламаны',
702702
},
703+
passwordUntrusted: {
704+
title: undefined,
705+
},
703706
phoneCode: {
704707
formTitle: 'Код верыфікацыі',
705708
resendButton: 'Пераадправіць код',

packages/localizations/src/bg-BG.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,9 @@ export const bgBG: LocalizationResource = {
696696
passwordPwned: {
697697
title: undefined,
698698
},
699+
passwordUntrusted: {
700+
title: undefined,
701+
},
699702
phoneCode: {
700703
formTitle: 'Код за потвърждение',
701704
resendButton: 'Не сте получили код? Изпрати отново',

packages/localizations/src/bn-IN.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,9 @@ export const bnIN: LocalizationResource = {
699699
passwordPwned: {
700700
title: 'পাসওয়ার্ড সমঝোতা হয়েছে',
701701
},
702+
passwordUntrusted: {
703+
title: undefined,
704+
},
702705
phoneCode: {
703706
formTitle: 'যাচাইকরণ কোড',
704707
resendButton: 'কোনো কোড পাননি? পুনরায় পাঠান',

packages/localizations/src/ca-ES.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,9 @@ export const caES: LocalizationResource = {
696696
passwordPwned: {
697697
title: undefined,
698698
},
699+
passwordUntrusted: {
700+
title: undefined,
701+
},
699702
phoneCode: {
700703
formTitle: 'Codi de verificació',
701704
resendButton: 'No has rebut el codi? Reenvia',

packages/localizations/src/cs-CZ.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,9 @@ export const csCZ: LocalizationResource = {
704704
passwordPwned: {
705705
title: 'Heslo kompromitováno',
706706
},
707+
passwordUntrusted: {
708+
title: undefined,
709+
},
707710
phoneCode: {
708711
formTitle: 'Ověřovací kód',
709712
resendButton: 'Neobdrželi jste kód? Znovu poslat',

packages/localizations/src/da-DK.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,9 @@ export const daDK: LocalizationResource = {
695695
passwordPwned: {
696696
title: 'Sikkerhedsadvarsel',
697697
},
698+
passwordUntrusted: {
699+
title: undefined,
700+
},
698701
phoneCode: {
699702
formTitle: 'Bekræftelseskode',
700703
resendButton: 'Send kode igen',

packages/localizations/src/de-DE.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,9 @@ export const deDE: LocalizationResource = {
709709
passwordPwned: {
710710
title: 'Passwort kompromittiert',
711711
},
712+
passwordUntrusted: {
713+
title: undefined,
714+
},
712715
phoneCode: {
713716
formTitle: 'Bestätigungscode',
714717
resendButton: 'Code erneut senden',

packages/localizations/src/el-GR.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,9 @@ export const elGR: LocalizationResource = {
697697
passwordPwned: {
698698
title: 'Παραβιασμένος κωδικός',
699699
},
700+
passwordUntrusted: {
701+
title: undefined,
702+
},
700703
phoneCode: {
701704
formTitle: 'Κωδικός επαλήθευσης',
702705
resendButton: 'Δεν λάβατε κωδικό; Αποστολή ξανά',

0 commit comments

Comments
 (0)