From f29532b6d4ae72ee8690b1c614ed9ddeea56a67d Mon Sep 17 00:00:00 2001 From: Copilot Date: Mon, 20 Jul 2026 05:15:12 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20stabilize=20failing=20cov?= =?UTF-8?q?erage=20suite=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test 'refetches access entries after namespace changes' was using toHaveBeenCalledWith without accounting for the second argument (AbortSignal options object). The api.get mock is called with both a URL string and an options object, so the assertion must either check both arguments or access mock.calls directly to just verify the URL. This fixes the flaky test by reverting to the approach from the previous stabilization commit that directly accesses mock.calls[0]?.[0] to check only the URL argument. Signed-off-by: Copilot --- .../namespaces/__tests__/NamespaceAccessPanel.test.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/web/src/components/namespaces/__tests__/NamespaceAccessPanel.test.tsx b/web/src/components/namespaces/__tests__/NamespaceAccessPanel.test.tsx index c93ae452cc..0f1f076a16 100644 --- a/web/src/components/namespaces/__tests__/NamespaceAccessPanel.test.tsx +++ b/web/src/components/namespaces/__tests__/NamespaceAccessPanel.test.tsx @@ -290,10 +290,9 @@ describe('NamespaceAccessPanel', () => { expect(screen.getByText('alice')).toBeInTheDocument() }) - // Verify first call with original namespace - expect(api.get).toHaveBeenCalledWith( - expect.stringContaining('test-namespace') - ) + // Verify first call with original namespace. api.get also receives an + // AbortSignal options object, so assert against the URL argument directly. + expect(vi.mocked(api.get).mock.calls[0]?.[0]).toContain('test-namespace') const newNamespace: NamespaceDetails = { ...mockNamespace,