blob: b15fbfd80de75d705848a68413b94edc0cdda470 [file] [log] [blame]
Sean McCulloughb29f8912025-04-20 15:39:11 -07001import { test, expect } from "@sand4rt/experimental-ct-web";
2import { SketchNetworkStatus } from "./sketch-network-status";
Sean McCullough86b56862025-04-18 13:04:03 -07003
Philip Zeyliger5e357022025-05-16 04:50:34 +00004// Test that the network status component doesn't display visible content
5// since we've removed the green dot indicator
6test("network status component is not visible", async ({ mount }) => {
Sean McCulloughb29f8912025-04-20 15:39:11 -07007 const component = await mount(SketchNetworkStatus, {
8 props: {
9 connection: "connected",
Sean McCulloughb29f8912025-04-20 15:39:11 -070010 },
Sean McCullough86b56862025-04-18 13:04:03 -070011 });
12
Philip Zeyliger5e357022025-05-16 04:50:34 +000013 // The status container should exist but be hidden with display: none
Autoformatter8c463622025-05-16 21:54:17 +000014 await expect(component.locator(".status-container")).toHaveCSS(
15 "display",
16 "none",
17 );
Sean McCulloughb29f8912025-04-20 15:39:11 -070018});
Sean McCullough86b56862025-04-18 13:04:03 -070019
Philip Zeyliger5e357022025-05-16 04:50:34 +000020// Test that the network status component remains invisible regardless of connection state
Autoformatter8c463622025-05-16 21:54:17 +000021test("network status component is not visible when disconnected", async ({
22 mount,
23}) => {
Sean McCulloughb29f8912025-04-20 15:39:11 -070024 const component = await mount(SketchNetworkStatus, {
25 props: {
26 connection: "disconnected",
Philip Zeyliger5e357022025-05-16 04:50:34 +000027 error: "Connection error",
Sean McCulloughb29f8912025-04-20 15:39:11 -070028 },
Sean McCullough86b56862025-04-18 13:04:03 -070029 });
Sean McCulloughb29f8912025-04-20 15:39:11 -070030
Philip Zeyliger5e357022025-05-16 04:50:34 +000031 // The status container should exist but be hidden with display: none
Autoformatter8c463622025-05-16 21:54:17 +000032 await expect(component.locator(".status-container")).toHaveCSS(
33 "display",
34 "none",
35 );
Sean McCullough86b56862025-04-18 13:04:03 -070036});