| ... | @@ -917,6 +917,59 @@ describe("GeneralSettingsPanel observability", () => { | ... | @@ -917,6 +917,59 @@ describe("GeneralSettingsPanel observability", () => { |
| 917 | await expect.element(page.getByText("Revoke others")).toBeInTheDocument(); | 917 | await expect.element(page.getByText("Revoke others")).toBeInTheDocument(); |
| 918 | }); | 918 | }); |
| 919 | | 919 | |
| | 920 | it("keeps authorized clients within a five-row fading scroll area", async () => { |
| | 921 | window.desktopBridge = createDesktopBridgeStub({ |
| | 922 | serverExposureState: { |
| | 923 | mode: "network-accessible", |
| | 924 | endpointUrl: "http://192.168.1.44:3773", |
| | 925 | advertisedHost: "192.168.1.44", |
| | 926 | tailscaleServeEnabled: false, |
| | 927 | tailscaleServePort: 443, |
| | 928 | }, |
| | 929 | }); |
| | 930 | authAccessHarness.setSnapshot({ |
| | 931 | pairingLinks: [], |
| | 932 | clientSessions: Array.from({ length: 7 }, (_, index) => |
| | 933 | makeClientSession({ |
| | 934 | sessionId: `session-client-${index}`, |
| | 935 | subject: `client-${index}`, |
| | 936 | scopes: ["orchestration:read"], |
| | 937 | method: "browser-session-cookie", |
| | 938 | client: { |
| | 939 | label: `Client ${index + 1}`, |
| | 940 | deviceType: "desktop", |
| | 941 | os: "macOS", |
| | 942 | browser: "Electron", |
| | 943 | ipAddress: `192.168.1.${index + 10}`, |
| | 944 | }, |
| | 945 | issuedAt: "2036-04-07T00:00:00.000Z", |
| | 946 | expiresAt: "2036-05-07T00:00:00.000Z", |
| | 947 | connected: index === 0, |
| | 948 | current: index === 0, |
| | 949 | }), |
| | 950 | ), |
| | 951 | }); |
| | 952 | setServerConfigSnapshot(createBaseServerConfig()); |
| | 953 | |
| | 954 | mounted = await render( |
| | 955 | <AppAtomRegistryProvider> |
| | 956 | <ConnectionsSettings /> |
| | 957 | </AppAtomRegistryProvider>, |
| | 958 | ); |
| | 959 | |
| | 960 | await expect.element(page.getByText("Client 7")).toBeInTheDocument(); |
| | 961 | const scrollArea = document.querySelector<HTMLElement>( |
| | 962 | '[data-testid="authorized-clients-scroll-area"]', |
| | 963 | ); |
| | 964 | const viewport = scrollArea?.querySelector<HTMLElement>('[data-slot="scroll-area-viewport"]'); |
| | 965 | |
| | 966 | expect(scrollArea).not.toBeNull(); |
| | 967 | expect(viewport).not.toBeNull(); |
| | 968 | expect(scrollArea?.clientHeight).toBe(360); |
| | 969 | expect(viewport?.scrollHeight).toBeGreaterThan(viewport?.clientHeight ?? 0); |
| | 970 | expect(viewport?.className).toContain("mask-b-from"); |
| | 971 | }); |
| | 972 | |
| 920 | it("revokes all other paired clients from settings", async () => { | 973 | it("revokes all other paired clients from settings", async () => { |
| 921 | window.desktopBridge = createDesktopBridgeStub({ | 974 | window.desktopBridge = createDesktopBridgeStub({ |
| 922 | serverExposureState: { | 975 | serverExposureState: { |