Skip to content

Commit

Permalink
small test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kayra1 committed Jun 13, 2024
1 parent 352678d commit c8b903e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ui/src/app/certificate_requests/row.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const setActionMenuExpanded = (val: number) => {
test('Certificate Requests Table Row', () => {
render(<Row id={csr.ID} csr={csr.CSR} certificate={csr.Certificate} ActionMenuExpanded={actionMenuExpanded} setActionMenuExpanded={setActionMenuExpanded as Dispatch<SetStateAction<number>>} />)
expect(screen.getByText('10.152.183.53')).toBeDefined() // Common name of CSR
expect(screen.getByText('Thu Mar 27 2025 15:48:04 GMT+0300 (GMT+03:00)')).toBeDefined()
expect(screen.getByLabelText('certificate-expiry-date').innerHTML).toMatch(/^Thu Mar 27/)
const openActionsButton = screen.getByLabelText("action-menu-button")
fireEvent.click(openActionsButton);
expect(actionMenuExpanded).toBe(1)
Expand Down
6 changes: 3 additions & 3 deletions ui/src/app/certificate_requests/row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function Row({ id, csr, certificate, ActionMenuExpanded, setActio
}
return (
<tr>
<td className="" width={5} data-test-column="id">{id}</td>
<td className="" width={5} aria-label="id">{id}</td>
<td className="">
<button
className="u-toggle p-contextual-menu__toggle p-button--base is-small"
Expand All @@ -36,8 +36,8 @@ export default function Row({ id, csr, certificate, ActionMenuExpanded, setActio
</button>
<span>{csrObj.subjects.find((e) => e.type == "Common Name")?.value}</span>
</td>
<td className="" data-test-column="status">{certificate == "" ? "outstanding" : (certificate == "rejected" ? "rejected" : "fulfilled")}</td>
<td className="" data-test-column="status">{certificate == "" ? "" : (certificate == "rejected" ? "" : certObj?.notAfter)}</td>
<td className="" aria-label="csr-status">{certificate == "" ? "outstanding" : (certificate == "rejected" ? "rejected" : "fulfilled")}</td>
<td className="" aria-label="certificate-expiry-date">{certificate == "" ? "" : (certificate == "rejected" ? "" : certObj?.notAfter)}</td>
<td className="has-overflow" data-heading="Actions">
<span className="p-contextual-menu--center u-no-margin--bottom">
<button
Expand Down

0 comments on commit c8b903e

Please sign in to comment.