mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: reduce storybook flakes (#17427)
A few storybook tests have been false positives quite frequently. To reduce this noise, I'm implementing a few hacks to avoid that. We can always rollback these changes if we notice they were leading to a lack in the tests.
This commit is contained in:
@@ -39,6 +39,11 @@ const meta: Meta<typeof OverviewPageView> = {
|
||||
invalidExperiments: [],
|
||||
safeExperiments: [],
|
||||
},
|
||||
parameters: {
|
||||
chromatic: {
|
||||
diffThreshold: 0.5,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default meta;
|
||||
|
||||
@@ -156,6 +156,7 @@ export const UserEngagementChart: FC<UserEngagementChartProps> = ({ data }) => {
|
||||
</defs>
|
||||
|
||||
<Area
|
||||
isAnimationActive={false}
|
||||
dataKey="users"
|
||||
type="linear"
|
||||
fill="url(#fillUsers)"
|
||||
|
||||
+7
@@ -6,6 +6,13 @@ import { PermissionPillsList } from "./PermissionPillsList";
|
||||
const meta: Meta<typeof PermissionPillsList> = {
|
||||
title: "pages/OrganizationCustomRolesPage/PermissionPillsList",
|
||||
component: PermissionPillsList,
|
||||
decorators: [
|
||||
(Story) => (
|
||||
<div style={{ width: "800px" }}>
|
||||
<Story />
|
||||
</div>
|
||||
),
|
||||
],
|
||||
};
|
||||
|
||||
export default meta;
|
||||
|
||||
@@ -121,7 +121,7 @@ export const JobRow: FC<JobRowProps> = ({ job }) => {
|
||||
<dd>{job.metadata.workspace_name ?? "null"}</dd>
|
||||
|
||||
<dt>Creation time:</dt>
|
||||
<dd>{job.created_at}</dd>
|
||||
<dd data-chromatic="ignore">{job.created_at}</dd>
|
||||
|
||||
<dt>Queue:</dt>
|
||||
<dd>
|
||||
|
||||
+2
-2
@@ -111,10 +111,10 @@ export const ProvisionerRow: FC<ProvisionerRowProps> = ({
|
||||
])}
|
||||
>
|
||||
<dt>Last seen:</dt>
|
||||
<dd>{provisioner.last_seen_at}</dd>
|
||||
<dd data-chromatic="ignore">{provisioner.last_seen_at}</dd>
|
||||
|
||||
<dt>Creation time:</dt>
|
||||
<dd>{provisioner.created_at}</dd>
|
||||
<dd data-chromatic="ignore">{provisioner.created_at}</dd>
|
||||
|
||||
<dt>Version:</dt>
|
||||
<dd>
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
MockAuthMethodsAll,
|
||||
MockBuildInfo,
|
||||
MockDefaultOrganization,
|
||||
MockDeploymentConfig,
|
||||
MockEntitlements,
|
||||
MockExperiments,
|
||||
MockUser,
|
||||
@@ -78,13 +79,27 @@ const meta = {
|
||||
data: { editWorkspaceProxies: true },
|
||||
},
|
||||
{ key: ["me", "appearance"], data: MockUserAppearanceSettings },
|
||||
{
|
||||
key: ["deployment", "config"],
|
||||
data: {
|
||||
...MockDeploymentConfig,
|
||||
config: {
|
||||
...MockDeploymentConfig.config,
|
||||
web_terminal_renderer: "canvas",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
chromatic: { delay: 300 },
|
||||
chromatic: {
|
||||
diffThreshold: 0.3,
|
||||
},
|
||||
},
|
||||
decorators: [
|
||||
(Story) => (
|
||||
<AuthProvider>
|
||||
<Story />
|
||||
<div style={{ width: 1170, height: 880 }}>
|
||||
<Story />
|
||||
</div>
|
||||
</AuthProvider>
|
||||
),
|
||||
],
|
||||
|
||||
@@ -316,6 +316,11 @@ export const TemplateInfoPopover: Story = {
|
||||
);
|
||||
});
|
||||
},
|
||||
parameters: {
|
||||
chromatic: {
|
||||
diffThreshold: 0.3,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const TemplateInfoPopoverWithoutDisplayName: Story = {
|
||||
|
||||
@@ -148,7 +148,7 @@ export const autostopDisplay = (
|
||||
if (template.autostop_requirement && template.allow_user_autostop) {
|
||||
title = <HelpTooltipTitle>Autostop schedule</HelpTooltipTitle>;
|
||||
reason = (
|
||||
<>
|
||||
<span data-chromatic="ignore">
|
||||
{" "}
|
||||
because this workspace has enabled autostop. You can disable autostop
|
||||
from this workspace's{" "}
|
||||
@@ -156,18 +156,18 @@ export const autostopDisplay = (
|
||||
schedule settings
|
||||
</Link>
|
||||
.
|
||||
</>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
return {
|
||||
message: `Stop ${deadline.fromNow()}`,
|
||||
tooltip: (
|
||||
<>
|
||||
<span data-chromatic="ignore">
|
||||
{title}
|
||||
This workspace will be stopped on{" "}
|
||||
{deadline.format("MMMM D [at] h:mm A")}
|
||||
{reason}
|
||||
</>
|
||||
</span>
|
||||
),
|
||||
danger: isShutdownSoon(workspace),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user