Skip to content

Commit

Permalink
chore: fix broken a11y test
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshsomasundaram-okta committed Jul 12, 2023
1 parent 6876dc6 commit 807ec54
Showing 1 changed file with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { MuiThemeDecorator } from "../../../../.storybook/components";
import { userEvent, waitFor, within } from "@storybook/testing-library";
import { expect } from "@storybook/jest";
import { axeRun } from "../../../axe-util";
import { screen } from "@storybook/testing-library";
import type { PlaywrightProps } from "../storybookTypes";
import { icons } from "../../../../.storybook/components/iconUtils";

Expand Down Expand Up @@ -104,13 +103,6 @@ const selectTab =
userEvent.tab();
const tabData = canvas.getByText(`Information about ${tabName}`);
expect(tabData).toBeInTheDocument();

if (actionName === "Tab Disabled") {
const disabledTab = canvas.getByText("Disabled Tab");
userEvent.click(disabledTab);
const tabData = screen.queryByText("Tab is disabled");
expect(tabData).not.toBeInTheDocument();
}
});
});
};
Expand Down Expand Up @@ -173,10 +165,10 @@ export const Icons: StoryObj<TabItemProps> = {
...DefaultTemplate,
args: {
startIcon: <BugIcon />,
label: "Icon Tab",
children: <ExampleTabContent label="Icon Tab" />,
label: "Xenomorphs",
children: <ExampleTabContent label="Xenomorphs" />,
},
play: async ({ canvasElement, step }) => {
selectTab({ canvasElement, step })("Tab Icon", "Icon Tab");
selectTab({ canvasElement, step })("Tab Icon", "Xenomorphs");
},
};

0 comments on commit 807ec54

Please sign in to comment.