diff --git a/site/src/components/Resources/AgentMetadata.tsx b/site/src/components/Resources/AgentMetadata.tsx index 53d6ad4feeb92..0c309492b86f4 100644 --- a/site/src/components/Resources/AgentMetadata.tsx +++ b/site/src/components/Resources/AgentMetadata.tsx @@ -201,7 +201,8 @@ const StaticWidth = (props: BoxProps) => { const ref = useRef(null) useEffect(() => { - if (!ref.current) { + // Ignore this in storybook + if (!ref.current || process.env.STORYBOOK === "true") { return } diff --git a/site/src/pages/DeploySettingsPage/GeneralSettingsPage/GeneralSettingsPageView.stories.tsx b/site/src/pages/DeploySettingsPage/GeneralSettingsPage/GeneralSettingsPageView.stories.tsx index 2a027ef7e9c41..9e65fca98cc3a 100644 --- a/site/src/pages/DeploySettingsPage/GeneralSettingsPage/GeneralSettingsPageView.stories.tsx +++ b/site/src/pages/DeploySettingsPage/GeneralSettingsPage/GeneralSettingsPageView.stories.tsx @@ -1,11 +1,8 @@ -import { ComponentMeta, Story } from "@storybook/react" +import { Meta, StoryObj } from "@storybook/react" import { mockApiError, MockDeploymentDAUResponse } from "testHelpers/entities" -import { - GeneralSettingsPageView, - GeneralSettingsPageViewProps, -} from "./GeneralSettingsPageView" +import { GeneralSettingsPageView } from "./GeneralSettingsPageView" -export default { +const meta: Meta = { title: "pages/GeneralSettingsPageView", component: GeneralSettingsPageView, args: { @@ -13,34 +10,58 @@ export default { { name: "Access URL", description: - "External URL to access your deployment. This must be accessible by all provisioned workspaces.", + "The URL that users will use to access the Coder deployment.", + flag: "access-url", + flag_shorthand: "", value: "https://dev.coder.com", + hidden: false, }, { name: "Wildcard Access URL", description: 'Specifies the wildcard hostname to use for workspace applications in the form "*.example.com".', + flag: "wildcard-access-url", + flag_shorthand: "", value: "*--apps.dev.coder.com", + hidden: false, + }, + { + name: "Experiments", + description: + "Enable one or more experiments. These are not ready for production. Separate multiple experiments with commas, or enter '*' to opt-in to all available experiments.", + flag: "experiments", + value: [ + "*", + "moons", + "workspace_actions", + "single_tailnet", + "deployment_health_page", + "template_parameters_insights", + ], + flag_shorthand: "", + hidden: false, }, ], deploymentDAUs: MockDeploymentDAUResponse, }, -} as ComponentMeta +} + +export default meta +type Story = StoryObj -const Template: Story = (args) => ( - -) -export const Page = Template.bind({}) +export const Page: Story = {} -export const NoDAUs = Template.bind({}) -NoDAUs.args = { - deploymentDAUs: undefined, +export const NoDAUs: Story = { + args: { + deploymentDAUs: undefined, + }, } -export const DAUError = Template.bind({}) -DAUError.args = { - deploymentDAUs: undefined, - getDeploymentDAUsError: mockApiError({ - message: "Error fetching DAUs.", - }), +export const DAUError: Story = { + args: { + deploymentDAUs: undefined, + getDeploymentDAUsError: mockApiError({ + message: "Error fetching DAUs.", + }), + }, } diff --git a/site/src/pages/WorkspacePage/WorkspaceBuildLogsSection.tsx b/site/src/pages/WorkspacePage/WorkspaceBuildLogsSection.tsx index 7c062d23614aa..795c77bc3521b 100644 --- a/site/src/pages/WorkspacePage/WorkspaceBuildLogsSection.tsx +++ b/site/src/pages/WorkspacePage/WorkspaceBuildLogsSection.tsx @@ -12,6 +12,11 @@ export const WorkspaceBuildLogsSection = ({ const scrollRef = useRef(null) useEffect(() => { + // Auto scrolling makes hard to snapshot test using Chromatic + if (process.env.STORYBOOK === "true") { + return + } + const scrollEl = scrollRef.current if (scrollEl) { scrollEl.scrollTop = scrollEl.scrollHeight