mirror of https://github.com/coder/coder.git
chore(site): use static date and ignore dynamic values for storybook (#12830)
This commit is contained in:
parent
1d2d008b45
commit
75bf41ba02
|
@ -12,6 +12,12 @@ const meta: Meta<typeof CreateTokenPage> = {
|
|||
},
|
||||
],
|
||||
},
|
||||
decorators: [
|
||||
(Story) => {
|
||||
Date.now = () => new Date("01/01/2014").getTime();
|
||||
return <Story />;
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default meta;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { Meta, StoryObj } from "@storybook/react";
|
||||
import { expect, userEvent, waitFor, within, screen } from "@storybook/test";
|
||||
import { addDays, addHours, addMinutes } from "date-fns";
|
||||
import { addHours, addMinutes } from "date-fns";
|
||||
import { getWorkspaceQuotaQueryKey } from "api/queries/workspaceQuota";
|
||||
import {
|
||||
MockTemplate,
|
||||
|
@ -159,7 +159,7 @@ export const Dormant: Story = {
|
|||
args: {
|
||||
workspace: {
|
||||
...baseWorkspace,
|
||||
deleting_at: addDays(new Date(), 7).toISOString(),
|
||||
deleting_at: new Date("2024/01/01").toISOString(),
|
||||
latest_build: {
|
||||
...baseWorkspace.latest_build,
|
||||
status: "failed",
|
||||
|
|
|
@ -219,10 +219,7 @@ export const WorkspaceTopbar: FC<WorkspaceProps> = ({
|
|||
title="Schedule settings"
|
||||
css={{ color: "inherit" }}
|
||||
>
|
||||
Deletion on{" "}
|
||||
<span data-chromatic="ignore">
|
||||
{new Date(workspace.deleting_at!).toLocaleString()}
|
||||
</span>
|
||||
Deletion on {new Date(workspace.deleting_at!).toLocaleString()}
|
||||
</Link>
|
||||
</TopbarData>
|
||||
)}
|
||||
|
|
Loading…
Reference in New Issue