A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/coder/coder/commit/4f98fd4e6eeb292a153cc95436dc3e1869cc54f1 below:

fix validation error during workspace creation without preset (#… · coder/coder@4f98fd4 · GitHub

@@ -201,6 +201,46 @@ export const PresetReselected: Story = {

201 201

},

202 202

};

203 203 204 +

export const PresetNoneSelected: Story = {

205 +

args: {

206 +

...PresetsButNoneSelected.args,

207 +

onSubmit: (request, owner) => {

208 +

// Assert that template_version_preset_id is not present in the request

209 +

console.assert(

210 +

!("template_version_preset_id" in request),

211 +

'template_version_preset_id should not be present when "None" is selected',

212 +

);

213 +

action("onSubmit")(request, owner);

214 +

},

215 +

},

216 +

play: async ({ canvasElement }) => {

217 +

const canvas = within(canvasElement);

218 + 219 +

// First select a preset to set the field value

220 +

await userEvent.click(canvas.getByLabelText("Preset"));

221 +

await userEvent.click(canvas.getByText("Preset 1"));

222 + 223 +

// Then select "None" to unset the field value

224 +

await userEvent.click(canvas.getByLabelText("Preset"));

225 +

await userEvent.click(canvas.getByText("None"));

226 + 227 +

// Fill in required fields and submit to test the API call

228 +

await userEvent.type(

229 +

canvas.getByLabelText("Workspace Name"),

230 +

"test-workspace",

231 +

);

232 +

await userEvent.click(canvas.getByText("Create workspace"));

233 +

},

234 +

parameters: {

235 +

docs: {

236 +

description: {

237 +

story:

238 +

"This story tests that when 'None' preset is selected, the template_version_preset_id field is not included in the form submission. The story first selects a preset to set the field value, then selects 'None' to unset it, and finally submits the form to verify the API call behavior.",

239 +

},

240 +

},

241 +

},

242 +

};

243 + 204 244

export const ExternalAuth: Story = {

205 245

args: {

206 246

externalAuth: [


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4