Skip to content

Commit 68de326

Browse files
committed
Use static date and ignore dynamic values
1 parent 1d2d008 commit 68de326

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

site/src/pages/CreateTokenPage/CreateTokenForm.tsx

+8-6
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,14 @@ export const CreateTokenForm: FC<CreateTokenFormProps> = ({
8080
<FormSection
8181
title="Expiration"
8282
description={
83-
form.values.lifetime
84-
? `The token will expire on ${dayjs()
85-
.add(form.values.lifetime, "days")
86-
.utc()
87-
.format("MMMM DD, YYYY")}`
88-
: "Please set a token expiration."
83+
<span data-chromatic="ignore">
84+
{form.values.lifetime
85+
? `The token will expire on ${dayjs()
86+
.add(form.values.lifetime, "days")
87+
.utc()
88+
.format("MMMM DD, YYYY")}`
89+
: "Please set a token expiration."}
90+
</span>
8991
}
9092
classes={{ sectionInfo: classNames.sectionInfo }}
9193
>

site/src/pages/WorkspacePage/WorkspaceTopbar.stories.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Meta, StoryObj } from "@storybook/react";
22
import { expect, userEvent, waitFor, within, screen } from "@storybook/test";
3-
import { addDays, addHours, addMinutes } from "date-fns";
3+
import { addHours, addMinutes } from "date-fns";
44
import { getWorkspaceQuotaQueryKey } from "api/queries/workspaceQuota";
55
import {
66
MockTemplate,
@@ -159,7 +159,7 @@ export const Dormant: Story = {
159159
args: {
160160
workspace: {
161161
...baseWorkspace,
162-
deleting_at: addDays(new Date(), 7).toISOString(),
162+
deleting_at: new Date("2024/01/01").toISOString(),
163163
latest_build: {
164164
...baseWorkspace.latest_build,
165165
status: "failed",

site/src/pages/WorkspacePage/WorkspaceTopbar.tsx

+1-4
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,7 @@ export const WorkspaceTopbar: FC<WorkspaceProps> = ({
219219
title="Schedule settings"
220220
css={{ color: "inherit" }}
221221
>
222-
Deletion on{" "}
223-
<span data-chromatic="ignore">
224-
{new Date(workspace.deleting_at!).toLocaleString()}
225-
</span>
222+
Deletion on {new Date(workspace.deleting_at!).toLocaleString()}
226223
</Link>
227224
</TopbarData>
228225
)}

0 commit comments

Comments
 (0)