Fixing failing JS ReportUpdatedCell.tests.tsx on main (#15880)

Fixing failing JS ReportUpdatedCell.tests.tsx on main
This commit is contained in:
Victor Lyuboslavsky 2024-01-02 17:25:07 -06:00 committed by GitHub
parent 5ef01b7fd6
commit fc32c2c44b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,13 +36,15 @@ describe("ReportUpdatedCell component", () => {
});
it("Renders a last-updated timestamp with tooltip and link to report when a last_fetched date is present", () => {
const tenDaysAgo = new Date();
tenDaysAgo.setDate(tenDaysAgo.getDate() - 10);
render(
<ReportUpdatedCell
interval={1000}
discard_data={false}
automations_enabled={false}
should_link_to_hqr
last_fetched="2023-11-29T15:20:02Z"
last_fetched={tenDaysAgo.toISOString()}
/>
);
@ -53,13 +55,15 @@ describe("ReportUpdatedCell component", () => {
expect(screen.getByText(/View report/)).toBeInTheDocument();
});
it("Renders a last-updated timestamp with tooltip and link to report when a last_fetched date is present but not currently running an interval", () => {
const tenDaysAgo = new Date();
tenDaysAgo.setDate(tenDaysAgo.getDate() - 10);
render(
<ReportUpdatedCell
interval={0}
discard_data={false}
automations_enabled={false}
should_link_to_hqr
last_fetched="2023-11-29T15:20:02Z"
last_fetched={tenDaysAgo.toISOString()}
/>
);