Skip to content

Commit

Permalink
ensure initially open tests are in a separate describe block and upda…
Browse files Browse the repository at this point in the history
…te the helper doc accordingly
  • Loading branch information
jcfranco committed Aug 14, 2024
1 parent d7250c8 commit 8662334
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 23 deletions.
11 changes: 6 additions & 5 deletions packages/calcite-components/src/components/dialog/dialog.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ describe("calcite-dialog", () => {
});

describe("openClose", () => {
const openCloseOptions = {
initialToggleValue: true,
};

openClose("calcite-dialog");
openClose("calcite-dialog", openCloseOptions);

describe("initially open", () => {
openClose("calcite-dialog", {
initialToggleValue: true,
});
});
});

describe("slots", () => {
Expand Down
11 changes: 6 additions & 5 deletions packages/calcite-components/src/components/modal/modal.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ describe("calcite-modal", () => {
});

describe("openClose", () => {
const openCloseOptions = {
initialToggleValue: true,
};

openClose("calcite-modal");
openClose("calcite-modal", openCloseOptions);

describe("initially open", () => {
openClose("calcite-modal", {
initialToggleValue: true,
});
});
});

describe("slots", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ describe("calcite-sheet properties", () => {
});

describe("openClose", () => {
describe("default", () => {
openClose("calcite-sheet");
});
openClose("calcite-sheet");

describe("initially open", () => {
openClose("calcite-sheet", {
Expand Down
22 changes: 12 additions & 10 deletions packages/calcite-components/src/tests/commonTests/openClose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,18 @@ interface OpenCloseOptions {
* }
* });
*
* openClose("calcite-combobox", {
* initialToggleValue: true,
* beforeToggle: {
* close: async (page) => {
* await page.keyboard.press("Tab");
* await page.waitForChanges();
* },
* }
* }
* })
* describe("initially open", () => {
* openClose("calcite-combobox", {
* initialToggleValue: true,
* beforeToggle: {
* close: async (page) => {
* await page.keyboard.press("Tab");
* await page.waitForChanges();
* },
* }
* }
* });
* });
*
* @param componentTagOrHTML - The component tag or HTML markup to test against.
* @param {object} [options] - Additional options to assert.
Expand Down

0 comments on commit 8662334

Please sign in to comment.