Fix IDP tests with additional cleanup (#3191)

This commit is contained in:
ikhomyn 2022-08-25 17:46:38 +02:00 committed by GitHub
parent de8258a4af
commit 821085935f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View file

@ -234,7 +234,14 @@ describe("User creation", () => {
]);
});
after(() => adminClient.deleteUser(usernameIdpLinksTest));
after(async () => {
await adminClient.deleteUser(usernameIdpLinksTest);
await Promise.all(
identityProviders.map((idp) =>
adminClient.deleteIdentityProvider(idp.alias)
)
);
});
beforeEach(() => {
usersPage.goToUserListTab().goToUserDetailsPage(usernameIdpLinksTest);

View file

@ -200,6 +200,13 @@ class AdminClient {
});
}
async deleteIdentityProvider(idpAlias: string) {
await this.login();
await this.client.identityProviders.del({
alias: idpAlias,
});
}
async unlinkAccountIdentityProvider(
username: string,
idpDisplayName: string