@gravitee/ui-policy-studio-angular 7.36.0 → 7.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@ import { MatSelectHarness } from '@angular/material/select/testing';
9
9
  import { GioFormTagsInputHarness } from '@gravitee/ui-particles-angular';
10
10
  import { MatSlideToggleHarness } from '@angular/material/slide-toggle/testing';
11
11
  import { MatMenuHarness } from '@angular/material/menu/testing';
12
- import { MatChipListHarness } from '@angular/material/chips/testing';
12
+ import { MatChipListboxHarness } from '@angular/material/chips/testing';
13
13
 
14
14
  /*
15
15
  * Copyright (C) 2023 The Gravitee team (http://gravitee.io)
@@ -1181,6 +1181,7 @@ class GioPolicyStudioPoliciesCatalogDialogHarness extends ComponentHarness {
1181
1181
  constructor() {
1182
1182
  super(...arguments);
1183
1183
  this.policiesLocator = this.locatorForAll(DivHarness.with({ selector: '.policiesCatalog__list__policy' }));
1184
+ this.getCategoriesFilter = this.locatorForOptional(MatChipListboxHarness.with({ selector: '[formControlName="categories"]' }));
1184
1185
  }
1185
1186
  async getPhase() {
1186
1187
  const phase = await this.locatorFor('.title__phase')();
@@ -1218,7 +1219,7 @@ class GioPolicyStudioPoliciesCatalogDialogHarness extends ComponentHarness {
1218
1219
  return await this.locatorFor(GioPolicyStudioStepFormHarness)();
1219
1220
  }
1220
1221
  async getCategoriesSelection() {
1221
- const chipList = await this.locatorForOptional(MatChipListHarness.with({ ancestor: '.policiesCatalog__categoriesSelection' }))();
1222
+ const chipList = await this.getCategoriesFilter();
1222
1223
  if (!chipList) {
1223
1224
  return [];
1224
1225
  }
@@ -1229,6 +1230,16 @@ class GioPolicyStudioPoliciesCatalogDialogHarness extends ComponentHarness {
1229
1230
  return { name, selected };
1230
1231
  }));
1231
1232
  }
1233
+ async selectCategoryFilter(categoryName) {
1234
+ const chipList = await this.getCategoriesFilter();
1235
+ await chipList?.selectChips({ text: categoryName });
1236
+ }
1237
+ async searchFilter(search) {
1238
+ const searchInput = await this.locatorFor(MatInputHarness.with({ selector: '[formControlName="search"]' }))();
1239
+ if (searchInput) {
1240
+ await searchInput.setValue(search);
1241
+ }
1242
+ }
1232
1243
  }
1233
1244
  GioPolicyStudioPoliciesCatalogDialogHarness.hostSelector = 'gio-ps-policies-catalog-dialog';
1234
1245