mirror of
https://github.com/logto-io/logto.git
synced 2025-04-07 23:01:25 -05:00
test: improve integration tests (#5577)
This commit is contained in:
parent
80a3808398
commit
2ae8c112f5
2 changed files with 15 additions and 0 deletions
|
@ -63,6 +63,15 @@ export const enableAllPasswordSignInMethods = async (
|
|||
mfa: { factors: [], policy: MfaPolicy.UserControlled },
|
||||
});
|
||||
|
||||
export const resetPasswordPolicy = async () =>
|
||||
updateSignInExperience({
|
||||
passwordPolicy: {
|
||||
length: { min: 8, max: 256 },
|
||||
characterTypes: { min: 1 },
|
||||
rejects: { pwned: true, repetitionAndSequence: true, userInfo: true },
|
||||
},
|
||||
});
|
||||
|
||||
export const enableAllVerificationCodeSignInMethods = async (
|
||||
signUp: SignInExperience['signUp'] = defaultSignUpMethod
|
||||
) =>
|
||||
|
|
|
@ -21,6 +21,7 @@ import { readConnectorMessage, expectRejects } from '#src/helpers/index.js';
|
|||
import {
|
||||
enableAllVerificationCodeSignInMethods,
|
||||
enableAllPasswordSignInMethods,
|
||||
resetPasswordPolicy,
|
||||
} from '#src/helpers/sign-in-experience.js';
|
||||
import { generateNewUserProfile, generateNewUser } from '#src/helpers/user.js';
|
||||
import { waitFor } from '#src/utils.js';
|
||||
|
@ -37,6 +38,8 @@ describe('register with username and password', () => {
|
|||
password: true,
|
||||
verify: false,
|
||||
});
|
||||
// Run it sequentially to avoid race condition
|
||||
await resetPasswordPolicy();
|
||||
|
||||
const { username, password } = generateNewUserProfile({ username: true, password: true });
|
||||
const client = await initClient();
|
||||
|
@ -62,7 +65,10 @@ describe('register with passwordless identifier', () => {
|
|||
await clearConnectorsByTypes([ConnectorType.Email, ConnectorType.Sms]);
|
||||
await setEmailConnector();
|
||||
await setSmsConnector();
|
||||
// Run it sequentially to avoid race condition
|
||||
await resetPasswordPolicy();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await clearConnectorsByTypes([ConnectorType.Email, ConnectorType.Sms]);
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue