Fixed navigation to mappers tab and added test (#3985)
This commit is contained in:
parent
9f917e2a65
commit
3c8e4f3b98
3 changed files with 24 additions and 1 deletions
|
@ -121,6 +121,15 @@ describe("OIDC identity provider test", () => {
|
|||
masthead.checkNotificationMessage(createMapperSuccessMsg, true);
|
||||
});
|
||||
|
||||
it("should cancel the addition of the OIDC mapper", () => {
|
||||
sidebarPage.goToIdentityProviders();
|
||||
listingPage.goToItemDetails(oidcProviderName);
|
||||
addMapperPage.goToMappersTab();
|
||||
addMapperPage.addMapper();
|
||||
addMapperPage.cancelNewMapper();
|
||||
addMapperPage.shouldGoToMappersTab();
|
||||
});
|
||||
|
||||
it("clean up providers", () => {
|
||||
const modalUtils = new ModalUtils();
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@ export default class AddMapperPage {
|
|||
private userSessionAttribute = "attribute";
|
||||
private userSessionAttributeValue = "attribute.value";
|
||||
private newMapperSaveButton = "new-mapper-save-button";
|
||||
private newMapperCancelButton = "new-mapper-cancel-button";
|
||||
private mappersUrl = "/oidc/mappers";
|
||||
private regexAttributeValuesSwitch = "are.attribute.values.regex";
|
||||
private syncmodeSelectToggle = "#syncMode";
|
||||
private attributesKeyInput = '[data-testid="config.attributes[0].key"]';
|
||||
|
@ -51,6 +53,11 @@ export default class AddMapperPage {
|
|||
return this;
|
||||
}
|
||||
|
||||
cancelNewMapper() {
|
||||
cy.findByTestId(this.newMapperCancelButton).click();
|
||||
return this;
|
||||
}
|
||||
|
||||
toggleSwitch(switchName: string) {
|
||||
cy.findByTestId(switchName).click({ force: true });
|
||||
|
||||
|
@ -396,4 +403,10 @@ export default class AddMapperPage {
|
|||
|
||||
return this;
|
||||
}
|
||||
|
||||
shouldGoToMappersTab() {
|
||||
cy.url().should("include", this.mappersUrl);
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -245,6 +245,7 @@ export default function AddMapper() {
|
|||
{t("common:save")}
|
||||
</Button>
|
||||
<Button
|
||||
data-testid="new-mapper-cancel-button"
|
||||
variant="link"
|
||||
component={(props) => (
|
||||
<Link
|
||||
|
@ -253,7 +254,7 @@ export default function AddMapper() {
|
|||
realm,
|
||||
providerId,
|
||||
alias: alias!,
|
||||
tab: "settings",
|
||||
tab: "mappers",
|
||||
})}
|
||||
/>
|
||||
)}
|
||||
|
|
Loading…
Reference in a new issue