Skip to content

Commit 9bb383a

Browse files
committed
chore: fix up storybook tests
Signed-off-by: Danny Kopping <danny@coder.com>
1 parent 590eb4e commit 9bb383a

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.stories.tsx

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,40 @@ export const Parameters: Story = {
120120
};
121121

122122
export const PresetsButNoneSelected: Story = {
123+
args: {
124+
presets: [
125+
{
126+
ID: "preset-1",
127+
Name: "Preset 1",
128+
Default: false,
129+
Parameters: [
130+
{
131+
Name: MockTemplateVersionParameter1.name,
132+
Value: "preset 1 override",
133+
},
134+
],
135+
},
136+
{
137+
ID: "preset-2",
138+
Name: "Preset 2",
139+
Default: false,
140+
Parameters: [
141+
{
142+
Name: MockTemplateVersionParameter2.name,
143+
Value: "42",
144+
},
145+
],
146+
},
147+
],
148+
parameters: [
149+
MockTemplateVersionParameter1,
150+
MockTemplateVersionParameter2,
151+
MockTemplateVersionParameter3,
152+
],
153+
},
154+
};
155+
156+
export const PresetsWithDefault: Story = {
123157
args: {
124158
presets: [
125159
{
@@ -243,6 +277,15 @@ export const PresetNoneSelected: Story = {
243277
},
244278
};
245279

280+
export const PresetWithDefaultAutoselected: Story = {
281+
args: PresetsWithDefault.args,
282+
play: async ({ canvasElement }) => {
283+
const canvas = within(canvasElement);
284+
// Toggle off the show preset parameters switch
285+
await userEvent.click(canvas.getByLabelText("Show preset parameters"));
286+
},
287+
};
288+
246289
export const ExternalAuth: Story = {
247290
args: {
248291
externalAuth: [

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy