Compare commits
No commits in common. "5a12718566626d251ed774558fa89248e255f495" and "12a76b4dd899e09e3a76a9f0b622cd3cff5e507d" have entirely different histories.
5a12718566
...
12a76b4dd8
@ -42,8 +42,11 @@ describe("Audit Log", () => {
|
||||
it("displays audit entries", async () => {
|
||||
render(<Security />);
|
||||
|
||||
// Wait for table to appear after async audit data loads
|
||||
const table = await screen.findByRole("table");
|
||||
// Wait for audit log to load
|
||||
await screen.findByText("Audit Log");
|
||||
|
||||
// Check that the table has rows (header + data rows)
|
||||
const table = screen.getByRole("table");
|
||||
expect(table).toBeInTheDocument();
|
||||
|
||||
const rows = screen.getAllByRole("row");
|
||||
@ -53,7 +56,9 @@ describe("Audit Log", () => {
|
||||
it("provides way to view transmitted data details", async () => {
|
||||
render(<Security />);
|
||||
|
||||
// Wait for async data to load and render the table
|
||||
await screen.findByText("Audit Log");
|
||||
|
||||
// Should have View/Hide buttons for expanding details
|
||||
const viewButtons = await screen.findAllByRole("button", { name: /View/i });
|
||||
expect(viewButtons.length).toBeGreaterThan(0);
|
||||
});
|
||||
@ -61,13 +66,14 @@ describe("Audit Log", () => {
|
||||
it("details column or button exists for viewing data", async () => {
|
||||
render(<Security />);
|
||||
|
||||
// Wait for async data to load and render the table
|
||||
await screen.findByRole("table");
|
||||
await screen.findByText("Audit Log");
|
||||
|
||||
// The audit log should have a Details column header
|
||||
const detailsHeader = screen.getByText("Details");
|
||||
expect(detailsHeader).toBeInTheDocument();
|
||||
|
||||
const viewButtons = screen.getAllByRole("button", { name: /View/i });
|
||||
// Should have view buttons
|
||||
const viewButtons = await screen.findAllByRole("button", { name: /View/i });
|
||||
expect(viewButtons.length).toBe(2); // One for each mock entry
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user