mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 03:37:34 +00:00
feat: allow usernames without @ when UserMustBeDomain false (#4852)
* feat: allow usernames without @ when UserMustBeDomain false * e2e * test(e2e): table driven tests for humans and machines * cleanup * fix(e2e): ensure there are no username conflicts * e2e: make awaitDesired async * rm settings mapping * e2e: make awaitDesired async * e2e: parse sequence as int * e2e: ensure test fails if awaitDesired fails Co-authored-by: Max Peintner <max@caos.ch>
This commit is contained in:
@@ -56,7 +56,6 @@ export function ensureSetting(
|
||||
'PUT',
|
||||
body,
|
||||
(entity) => !!entity,
|
||||
(body) => body?.settings?.id,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -66,14 +65,15 @@ function awaitDesired(
|
||||
search: () => Cypress.Chainable<SearchResult>,
|
||||
initialSequence?: number,
|
||||
) {
|
||||
search().then((resp) => {
|
||||
return search().then((resp) => {
|
||||
const foundExpectedEntity = expectEntity(resp.entity);
|
||||
const foundExpectedSequence = !initialSequence || resp.sequence >= initialSequence;
|
||||
|
||||
if (!foundExpectedEntity || !foundExpectedSequence) {
|
||||
const check = !foundExpectedEntity || !foundExpectedSequence;
|
||||
if (check) {
|
||||
expect(trials, `trying ${trials} more times`).to.be.greaterThan(0);
|
||||
cy.wait(1000);
|
||||
awaitDesired(trials - 1, expectEntity, search, initialSequence);
|
||||
return awaitDesired(trials - 1, expectEntity, search, initialSequence);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -117,7 +117,8 @@ export function ensureSomething(
|
||||
});
|
||||
})
|
||||
.then((data) => {
|
||||
awaitDesired(90, expectEntity, search, data.sequence);
|
||||
return cy.wrap<number>(data.id);
|
||||
return awaitDesired(90, expectEntity, search, data.sequence).then(() => {
|
||||
return cy.wrap<number>(data.id);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user