Skip to content

Commit

Permalink
remove visual tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alastair-simon committed Jan 8, 2025
1 parent 05fc1b0 commit 54dc446
Showing 1 changed file with 0 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -460,42 +460,4 @@ export const VisualTestColorpickerWithHelpText: MtColorpickerStory = {
},
};

export const VisualTestOpenColorpickerColorKeyboard: MtColorpickerStory = {
name: "Open color picker with keyboard",
args: {
modelValue: "rgba(72, 228, 37, 0.81)",
},
play: async () => {
await userEvent.keyboard("{Tab}");
await userEvent.keyboard("{Enter}");

//Look inside the popover
const popover = within(
document.getElementsByClassName("mt-floating-ui__content")[0] as HTMLElement,
);

expect(popover).toBeDefined();
},
};

export const VisualTestChangeColorpickerValueWithKeyboard: MtColorpickerStory = {
name: "Change value with keyboard",
args: {
modelValue: "#0fcff5",
},
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);

//Focus & open colorpicker
await userEvent.keyboard("{Tab}");
await userEvent.keyboard("{Enter}");

//Focus color slider & change value /correct
await userEvent.keyboard("{Tab}");
await userEvent.keyboard("{arrowleft}");

const colorValue = canvas.getByLabelText("colorpicker-color-value") as HTMLInputElement;
expect(colorValue).toBeDefined();
expect(colorValue.value).toEqual("#10cef4");
},
};

0 comments on commit 54dc446

Please sign in to comment.