mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 01:18:42 +00:00
Test fix - increase test regex matching (#16055)
Fix a broken datetime-based test - [x] Manual QA for all new/changed functionality Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
This commit is contained in:
parent
7c84588689
commit
9ee03b5c5f
1 changed files with 4 additions and 6 deletions
|
|
@ -4,6 +4,8 @@ import { render, screen } from "@testing-library/react";
|
|||
|
||||
import ReportUpdatedCell from "./ReportUpdatedCell";
|
||||
|
||||
const HUMAN_READABLE_DATETIME_REGEX = /\d{1,2}\/{1,2}\d\/\d\d\d\d, \d{1,2}:\d{1,2}:\d{1,2}\s(A|P)M/;
|
||||
|
||||
describe("ReportUpdatedCell component", () => {
|
||||
it("Renders '---' with tooltip and no link when run on an interval with discard data and automations enabled", () => {
|
||||
render(
|
||||
|
|
@ -48,9 +50,7 @@ describe("ReportUpdatedCell component", () => {
|
|||
/>
|
||||
);
|
||||
|
||||
expect(
|
||||
screen.getByText(/\d\d\/\d\d\/\d\d\d\d, \d{1,2}:\d{1,2}:\d{1,2}( AM|PM)?/)
|
||||
).toBeInTheDocument();
|
||||
expect(screen.getByText(HUMAN_READABLE_DATETIME_REGEX)).toBeInTheDocument();
|
||||
expect(screen.getByText(/\d+.+ago/)).toBeInTheDocument();
|
||||
expect(screen.getByText(/View report/)).toBeInTheDocument();
|
||||
});
|
||||
|
|
@ -67,9 +67,7 @@ describe("ReportUpdatedCell component", () => {
|
|||
/>
|
||||
);
|
||||
|
||||
expect(
|
||||
screen.getByText(/\d\d\/\d\d\/\d\d\d\d, \d{1,2}:\d{1,2}:\d{1,2}( AM|PM)?/)
|
||||
).toBeInTheDocument();
|
||||
expect(screen.getByText(HUMAN_READABLE_DATETIME_REGEX)).toBeInTheDocument();
|
||||
expect(screen.getByText(/\d+.+ago/)).toBeInTheDocument();
|
||||
expect(screen.getByText(/View report/)).toBeInTheDocument();
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue