From 4e955b04b564c23dc647089a99035bb85f23ceb5 Mon Sep 17 00:00:00 2001 From: yazansalti Date: Mon, 1 Jul 2024 13:08:00 +0200 Subject: [PATCH] Fixes tests --- ui/src/app/certificate_requests/row.test.tsx | 3 ++- ui/src/app/certificate_requests/table.test.tsx | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/src/app/certificate_requests/row.test.tsx b/ui/src/app/certificate_requests/row.test.tsx index c0cc548..d36f9e8 100644 --- a/ui/src/app/certificate_requests/row.test.tsx +++ b/ui/src/app/certificate_requests/row.test.tsx @@ -61,7 +61,8 @@ test('Certificate Requests Table Row', () => { >} /> ) - expect(screen.getByText('10.152.183.53')).toBeDefined() // Common name of CSR + const commonNames = screen.getAllByText('10.152.183.53'); + expect(commonNames.length).toBeGreaterThan(0); expect(screen.getByLabelText('certificate-expiry-date').innerHTML).toMatch(/^Thu Mar 27/) const openActionsButton = screen.getByLabelText("action-menu-button") fireEvent.click(openActionsButton); diff --git a/ui/src/app/certificate_requests/table.test.tsx b/ui/src/app/certificate_requests/table.test.tsx index 9a075f4..e481d6b 100644 --- a/ui/src/app/certificate_requests/table.test.tsx +++ b/ui/src/app/certificate_requests/table.test.tsx @@ -100,6 +100,6 @@ test('CertificateRequestsPage', () => { < CertificateRequestsTable csrs={rows} /> ) - expect(screen.getByRole('table', {})).toBeDefined() - expect(screen.getByText('example.com')).toBeDefined() // Common Name of one of the CSR's + const commonNames = screen.getAllByText('example.com'); + expect(commonNames.length).toBeGreaterThan(0); }) \ No newline at end of file