@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.cjs.js CHANGED
@@ -192020,32 +192020,27 @@ class EditorPage {
192020
192020
  };
192021
192021
  this.verifyFontSize = async () => {
192022
192022
  const fontsAndTexts = [];
192023
- await this.page
192024
- .getByTestId(NEETO_EDITOR_SELECTORS.neetoEditorFixedMenuFontSize)
192025
- .click();
192026
- const allButtons = await this.page
192023
+ const fontSizeDropdownButton = this.page.getByTestId(NEETO_EDITOR_SELECTORS.neetoEditorFixedMenuFontSize);
192024
+ await fontSizeDropdownButton.click();
192025
+ const headingButtons = await this.page
192027
192026
  .getByTestId(COMMON_SELECTORS.dropdownContainer)
192028
192027
  .getByRole("button")
192029
192028
  .all();
192030
- const headingButtons = (await Promise.all(allButtons.map(async (button) => {
192029
+ const headingLevels = (await Promise.all(headingButtons.map(async (button) => {
192031
192030
  const dataCy = await button.getAttribute("data-cy");
192032
- return /^neeto-editor-fixed-menu-font-size-option-h[1-6]$/.test(dataCy || "")
192033
- ? button
192034
- : null;
192031
+ const headingLevel = dataCy === null || dataCy === void 0 ? void 0 : dataCy.split("-").pop();
192032
+ return /^h[1-5]$/.test(headingLevel || "") ? headingLevel : null;
192035
192033
  }))).filter(Boolean);
192036
- for (const button of headingButtons) {
192037
- const dataCy = await button.getAttribute("data-cy");
192038
- const fontKey = dataCy === null || dataCy === void 0 ? void 0 : dataCy.split("-").pop();
192039
- if (!fontKey)
192040
- continue;
192041
- const headingLevel = Number(fontKey.slice(1));
192034
+ const fontSizeDropdown = this.editorWrapper.getByTestId(NEETO_EDITOR_SELECTORS.fontSize);
192035
+ for (const headingLevel of headingLevels) {
192036
+ const fontKey = headingLevel;
192042
192037
  const randomText = await this.fillRandomText();
192043
- await this.page
192044
- .getByTestId(NEETO_EDITOR_SELECTORS.neetoEditorFixedMenuFontSize)
192038
+ await fontSizeDropdown.click();
192039
+ await this.editorWrapper
192040
+ .getByTestId(FONT_SIZE_SELECTORS[fontKey])
192045
192041
  .click();
192046
- await button.click();
192047
192042
  await test$1.expect(this.contentField.getByRole("heading", {
192048
- level: headingLevel,
192043
+ level: Number(headingLevel === null || headingLevel === void 0 ? void 0 : headingLevel.slice(1)),
192049
192044
  name: randomText,
192050
192045
  })).toBeVisible();
192051
192046
  fontsAndTexts.push({
@@ -193253,7 +193248,7 @@ class RolesPage {
193253
193248
  const { permissions } = await this.roleApis
193254
193249
  .fetch("permissions")
193255
193250
  .then(response => response === null || response === void 0 ? void 0 : response.json());
193256
- const permissionObjects = targetPermissions.map(permission => neetoCist.findBy({ category: permission }, permissions));
193251
+ const permissionObjects = targetPermissions.flatMap(permission => permissions.filter((p) => p.category === permission));
193257
193252
  return ramda.pluck("id", permissionObjects);
193258
193253
  };
193259
193254
  this.getRoleIdAndOrganizationId = async (roleName) => {