-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
63 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { expect, test } from 'vitest' | ||
import { render, screen } from '@testing-library/react' | ||
import CertificateRequests from './page' | ||
|
||
test('CertificateRequestsPage', () => { | ||
render(< CertificateRequests />) | ||
expect(screen.getByRole('table', {})).toBeDefined() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { expect, test } from 'vitest' | ||
import { render, screen } from '@testing-library/react' | ||
import Row from './row' | ||
|
||
test('Certificate Requests Table Row', () => { | ||
render(<Row id={1} csr='' certificate='' />) | ||
expect(screen.getByRole('table', {})).toBeDefined() | ||
Check failure on line 7 in ui/src/app/certificate_requests/row.test.tsx GitHub Actions / unit-test-frontend / nextjs-unit-testssrc/app/certificate_requests/row.test.tsx > Certificate Requests Table Row
|
||
}) | ||
// when certificate rejected => rejected status | ||
// when certificate empty => outstanding status | ||
// when certificate anything else => certificate.NotAfter | ||
|
||
|
||
// TODO button call correct api endpoints test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const extractCSR = (csrPemString: string) => { | ||
//TODO | ||
} | ||
|
||
const extractCert = (certPemString: string) => { | ||
//TODO | ||
} | ||
|
||
type rowProps = { | ||
id: number, | ||
csr: string, | ||
certificate: string | ||
} | ||
export default function Row({ id, csr, certificate }: rowProps) { | ||
return ( | ||
<tr data-test-model-uuid="2f995dee-392e-4459-8eb9-839c501590af"> | ||
<td className="" data-test-column="id">{id}</td> | ||
<td className="u-overflow--visible" data-test-column="details"> | ||
<p>CN: example.com</p> | ||
<p>SAN: example.com, 127.0.0.1, 1.2.3.4.5.56</p> | ||
</td> | ||
<td className="" data-test-column="status">{certificate == "" ? "outstanding" : (certificate == "rejected" ? "rejected" : "certificate expiry date here")}</td> | ||
<td className="" data-test-column="action"> | ||
<button>Sign</button> | ||
<button>Reject</button> | ||
</td> | ||
<td className="" data-test-column="delete"> | ||
<button>Delete CSR</button> | ||
</td> | ||
</tr> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
// when add cert button clicked, asideOpen called |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,4 @@ export default function RootLayout({ | |
</body> | ||
</html> | ||
); | ||
} | ||
} |
Empty file.