Skip to content

Commit

Permalink
Merge pull request #6369 from Sage/icon-button-playwright-refactor
Browse files Browse the repository at this point in the history
test(icon-button): add playwright tests
  • Loading branch information
divyajindel authored Nov 1, 2023
2 parents 8fa324c + dff1b79 commit aeb530d
Show file tree
Hide file tree
Showing 5 changed files with 233 additions and 163 deletions.
155 changes: 0 additions & 155 deletions cypress/components/icon-button/icon-button.cy.tsx

This file was deleted.

5 changes: 5 additions & 0 deletions playwright/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
STICKY_FOOTER,
COMMMON_DATA_ELEMENT_INPUT,
PORTAL,
BUTTON,
} from "./locators";

export const icon = (page: Page) => {
Expand All @@ -25,6 +26,10 @@ export const commonDataElementInputPreview = (page: Page) => {
return page.locator(COMMMON_DATA_ELEMENT_INPUT);
};

export const button = (page: Page) => {
return page.locator(BUTTON);
};

export const closeIconButton = (page: Page) => {
return page.locator(CLOSE_ICON_BUTTON);
};
Expand Down
13 changes: 13 additions & 0 deletions src/components/icon-button/component.test-pw.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";
import IconButton, { IconButtonProps } from ".";
import Icon from "../icon";

const IconButtonComponent = (props: Partial<IconButtonProps>) => {
return (
<IconButton aria-label="icon-button" onClick={() => {}} {...props}>
<Icon type="home" />
</IconButton>
);
};

export default IconButtonComponent;
8 changes: 0 additions & 8 deletions src/components/icon-button/icon-button-test.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,3 @@ export const Default = (props: IconButtonProps) => {
};

Default.storyName = "default";

export const IconButtonComponent = (props: Partial<IconButtonProps>) => {
return (
<IconButton aria-label="icon-button" onClick={() => {}} {...props}>
<Icon type="home" />
</IconButton>
);
};
Loading

0 comments on commit aeb530d

Please sign in to comment.