Skip to content

Commit

Permalink
test(portrait): remove disabled color contrast rules in fixed tests a…
Browse files Browse the repository at this point in the history
…nd remove invalid tooltip tests
  • Loading branch information
tomdavies73 committed Oct 23, 2023
1 parent 08efff9 commit 6805001
Showing 1 changed file with 8 additions and 32 deletions.
40 changes: 8 additions & 32 deletions src/components/portrait/portrait.pw.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ test.describe("Event checks for Portrait component", () => {
});
});

// TODO: remove "color-contrast" disabled rules parameter from all relevant accessibility tests upon the completion of FE-6202
test.describe("Accessibility tests for Portrait component", () => {
test("should pass accessibility checks when gravatar is passed", async ({
mount,
Expand Down Expand Up @@ -413,7 +412,7 @@ test.describe("Accessibility tests for Portrait component", () => {
}) => {
await mount(<PortraitDefaultComponent size={size} />);

await checkAccessibility(page, "color-contrast");
await checkAccessibility(page);
});
});

Expand All @@ -423,7 +422,7 @@ test.describe("Accessibility tests for Portrait component", () => {
}) => {
await mount(<PortraitDefaultComponent alt="playwright-test" />);

await checkAccessibility(page, "color-contrast");
await checkAccessibility(page);
});

["square", "circle"].forEach((shape) => {
Expand All @@ -433,7 +432,7 @@ test.describe("Accessibility tests for Portrait component", () => {
}) => {
await mount(<PortraitDefaultComponent shape={shape} />);

await checkAccessibility(page, "color-contrast");
await checkAccessibility(page);
});
});

Expand All @@ -444,7 +443,7 @@ test.describe("Accessibility tests for Portrait component", () => {
}) => {
await mount(<PortraitDefaultComponent iconType={iconType} />);

await checkAccessibility(page, "color-contrast");
await checkAccessibility(page);
});
});

Expand All @@ -455,7 +454,7 @@ test.describe("Accessibility tests for Portrait component", () => {
}) => {
await mount(<PortraitDefaultComponent initials={passInitials} />);

await checkAccessibility(page, "color-contrast");
await checkAccessibility(page);
});
});

Expand All @@ -469,7 +468,7 @@ test.describe("Accessibility tests for Portrait component", () => {
}) => {
await mount(<PortraitDefaultComponent darkBackground={boolVal} />);

await checkAccessibility(page, "color-contrast");
await checkAccessibility(page);
});
});

Expand All @@ -481,7 +480,6 @@ test.describe("Accessibility tests for Portrait component", () => {
await mount(
<PortraitComponent tooltipIsVisible tooltipMessage={tooltipMessage} />
);

await checkAccessibility(page, "color-contrast");
});
});
Expand Down Expand Up @@ -538,29 +536,7 @@ test.describe("Accessibility tests for Portrait component", () => {
mount,
page,
}) => {
await mount(<PortraitComponent size={tooltipSize} />);

await checkAccessibility(page, "color-contrast");
});
});

colors.forEach(([names]) => {
test(`should pass accessibility checks with a tooltip, with a ${names} background color`, async ({
mount,
page,
}) => {
await mount(<PortraitComponent tooltipBgColor={names} />);

await checkAccessibility(page, "color-contrast");
});
});

colors.forEach(([names]) => {
test(`should pass accessibility checks with a tooltip, with a ${names} font color`, async ({
mount,
page,
}) => {
await mount(<PortraitComponent tooltipFontColor={names} />);
await mount(<PortraitComponent tooltipSize={tooltipSize} />);

await checkAccessibility(page, "color-contrast");
});
Expand All @@ -573,6 +549,6 @@ test.describe("Accessibility tests for Portrait component", () => {
let callbackCount = 0;
await mount(<PortraitDefaultComponent onClick={(callbackCount += 1)} />);

await checkAccessibility(page, "color-contrast");
await checkAccessibility(page);
});
});

0 comments on commit 6805001

Please sign in to comment.