catch errors when removing scope type
This commit is contained in:
parent
df5a06a3be
commit
bb090200fe
2 changed files with 20 additions and 24 deletions
|
@ -1,26 +1,15 @@
|
|||
export default class ListingPage {
|
||||
searchInput: string;
|
||||
itemsRows: string;
|
||||
itemRowDrpDwn: string;
|
||||
exportBtn: string;
|
||||
deleteBtn: string;
|
||||
searchBtn: string;
|
||||
createBtn: string;
|
||||
importBtn: string;
|
||||
|
||||
constructor() {
|
||||
this.searchInput = '.pf-c-toolbar__item [type="search"]:visible';
|
||||
this.itemsRows = "table";
|
||||
this.itemRowDrpDwn = ".pf-c-dropdown > button";
|
||||
this.exportBtn = '[role="menuitem"]:nth-child(1)';
|
||||
this.deleteBtn = '[role="menuitem"]:nth-child(2)';
|
||||
this.searchBtn =
|
||||
".pf-c-page__main .pf-c-toolbar__content-section button.pf-m-control:visible";
|
||||
this.createBtn =
|
||||
".pf-c-page__main .pf-c-toolbar__content-section button.pf-m-primary:visible";
|
||||
this.importBtn =
|
||||
".pf-c-page__main .pf-c-toolbar__content-section button.pf-m-link";
|
||||
}
|
||||
private searchInput = '.pf-c-toolbar__item [type="search"]:visible';
|
||||
private itemsRows = "table";
|
||||
private itemRowDrpDwn = ".pf-c-dropdown__toggle";
|
||||
public exportBtn = '[role="menuitem"]:nth-child(1)';
|
||||
public deleteBtn = '[role="menuitem"]:nth-child(2)';
|
||||
private searchBtn =
|
||||
".pf-c-page__main .pf-c-toolbar__content-section button.pf-m-control:visible";
|
||||
private createBtn =
|
||||
".pf-c-page__main .pf-c-toolbar__content-section button.pf-m-primary:visible";
|
||||
private importBtn =
|
||||
".pf-c-page__main .pf-c-toolbar__content-section button.pf-m-link";
|
||||
|
||||
goToCreateItem() {
|
||||
cy.get(this.createBtn).click();
|
||||
|
@ -50,7 +39,7 @@ export default class ListingPage {
|
|||
clickRowDetails(itemName: string) {
|
||||
cy.get(this.itemsRows)
|
||||
.contains(itemName)
|
||||
.parentsUntil("tr")
|
||||
.parentsUntil("tbody")
|
||||
.find(this.itemRowDrpDwn)
|
||||
.click();
|
||||
return this;
|
||||
|
|
|
@ -83,7 +83,14 @@ export const ClientScopesSection = () => {
|
|||
onConfirm: async () => {
|
||||
try {
|
||||
for (const scope of selectedScopes) {
|
||||
await removeScope(adminClient, scope);
|
||||
try {
|
||||
await removeScope(adminClient, scope);
|
||||
} catch (error) {
|
||||
console.warn(
|
||||
"could not remove scope",
|
||||
error.response?.data?.errorMessage || error
|
||||
);
|
||||
}
|
||||
await adminClient.clientScopes.del({ id: scope.id! });
|
||||
}
|
||||
addAlert(t("deletedSuccess"), AlertVariant.success);
|
||||
|
|
Loading…
Reference in a new issue