30 lines
1.2 KiB
TypeScript
30 lines
1.2 KiB
TypeScript
import { expect, test } from "@playwright/experimental-ct-react";
|
|
|
|
import { TelephonyInterimVisualFixture as VisualFixture } from "../../apps/web/app/components/screens/telephony/telephony-interim.visual-fixture";
|
|
|
|
const VISUAL_SCREENS = ["settings", "calls", "call-detail", "click-to-call"] as const;
|
|
|
|
test.describe("AK-P15a telephony interim UI pixel baseline", () => {
|
|
for (const screen of VISUAL_SCREENS) {
|
|
test(`${screen} stays visually stable in light mode`, async ({ mount, page }) => {
|
|
const component = await mount(
|
|
<div data-testid={`ak-p15a-${screen}`} style={{ width: "1280px", minHeight: "720px" }}>
|
|
<VisualFixture screen={screen} />
|
|
</div>,
|
|
);
|
|
|
|
await page.evaluate(async () => {
|
|
await document.fonts.ready;
|
|
});
|
|
|
|
if (screen === "click-to-call") {
|
|
await expect(page.locator("[data-ui-id='ui.telephony.clickToCall.dialog']")).toHaveCount(1);
|
|
await expect(page).toHaveScreenshot("ak-p15a-telephony-click-to-call.png");
|
|
} else {
|
|
await expect(component.locator("[data-ui-id$='.page']")).toHaveCount(1);
|
|
await expect(component).toHaveScreenshot(`ak-p15a-telephony-${screen}.png`);
|
|
}
|
|
});
|
|
}
|
|
});
|