@bigbinary/neeto-playwright-commons 1.21.0 → 1.21.1

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.
package/index.d.ts CHANGED
@@ -3486,7 +3486,7 @@ declare class RolesPage {
3486
3486
  roleApis: RoleApis;
3487
3487
  t: TFunction;
3488
3488
  constructor(page: Page, neetoPlaywrightUtilities: CustomCommands);
3489
- getPermissionIds: (targetPermissions: string[]) => Promise<string[]>;
3489
+ getPermissionIds: (targetPermissions: string[]) => Promise<any[]>;
3490
3490
  getRoleIdAndOrganizationId: (roleName: string) => Promise<{
3491
3491
  roleId: string;
3492
3492
  organizationId: string;
package/index.js CHANGED
@@ -192000,32 +192000,27 @@ class EditorPage {
192000
192000
  };
192001
192001
  this.verifyFontSize = async () => {
192002
192002
  const fontsAndTexts = [];
192003
- await this.page
192004
- .getByTestId(NEETO_EDITOR_SELECTORS.neetoEditorFixedMenuFontSize)
192005
- .click();
192006
- const allButtons = await this.page
192003
+ const fontSizeDropdownButton = this.page.getByTestId(NEETO_EDITOR_SELECTORS.neetoEditorFixedMenuFontSize);
192004
+ await fontSizeDropdownButton.click();
192005
+ const headingButtons = await this.page
192007
192006
  .getByTestId(COMMON_SELECTORS.dropdownContainer)
192008
192007
  .getByRole("button")
192009
192008
  .all();
192010
- const headingButtons = (await Promise.all(allButtons.map(async (button) => {
192009
+ const headingLevels = (await Promise.all(headingButtons.map(async (button) => {
192011
192010
  const dataCy = await button.getAttribute("data-cy");
192012
- return /^neeto-editor-fixed-menu-font-size-option-h[1-6]$/.test(dataCy || "")
192013
- ? button
192014
- : null;
192011
+ const headingLevel = dataCy === null || dataCy === void 0 ? void 0 : dataCy.split("-").pop();
192012
+ return /^h[1-5]$/.test(headingLevel || "") ? headingLevel : null;
192015
192013
  }))).filter(Boolean);
192016
- for (const button of headingButtons) {
192017
- const dataCy = await button.getAttribute("data-cy");
192018
- const fontKey = dataCy === null || dataCy === void 0 ? void 0 : dataCy.split("-").pop();
192019
- if (!fontKey)
192020
- continue;
192021
- const headingLevel = Number(fontKey.slice(1));
192014
+ const fontSizeDropdown = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.fontSize);
192015
+ for (const headingLevel of headingLevels) {
192016
+ const fontKey = headingLevel;
192022
192017
  const randomText = await this.fillRandomText();
192023
- await this.page
192024
- .getByTestId(NEETO_EDITOR_SELECTORS.neetoEditorFixedMenuFontSize)
192018
+ await fontSizeDropdown.click();
192019
+ await this.editorWrapper
192020
+ .getByTestId(FONT_SIZE_SELECTORS[fontKey])
192025
192021
  .click();
192026
- await button.click();
192027
192022
  await expect(this.contentField.getByRole("heading", {
192028
- level: headingLevel,
192023
+ level: Number(headingLevel === null || headingLevel === void 0 ? void 0 : headingLevel.slice(1)),
192029
192024
  name: randomText,
192030
192025
  })).toBeVisible();
192031
192026
  fontsAndTexts.push({
@@ -193233,7 +193228,7 @@ class RolesPage {
193233
193228
  const { permissions } = await this.roleApis
193234
193229
  .fetch("permissions")
193235
193230
  .then(response => response === null || response === void 0 ? void 0 : response.json());
193236
- const permissionObjects = targetPermissions.map(permission => findBy({ category: permission }, permissions));
193231
+ const permissionObjects = targetPermissions.flatMap(permission => permissions.filter((p) => p.category === permission));
193237
193232
  return pluck("id", permissionObjects);
193238
193233
  };
193239
193234
  this.getRoleIdAndOrganizationId = async (roleName) => {