MCPcopy Create free account
hub / github.com/coder/coder / updateTemplateSettings

Function updateTemplateSettings

site/e2e/helpers.ts:1165–1190  ·  view source on GitHub ↗
(
	page: Page,
	templateName: string,
	templateSettingValues: Pick<
		UpdateTemplateMeta,
		"name" | "display_name" | "description" | "deprecation_message"
	>,
)

Source from the content-addressed store, hash-verified

1163};
1164
1165export const updateTemplateSettings = async (
1166 page: Page,
1167 templateName: string,
1168 templateSettingValues: Pick<
1169 UpdateTemplateMeta,
1170 "name" | "display_name" | "description" | "deprecation_message"
1171 >,
1172) => {
1173 await page.goto(`/templates/${templateName}/settings`, {
1174 waitUntil: "domcontentloaded",
1175 });
1176
1177 for (const [key, value] of Object.entries(templateSettingValues)) {
1178 // Skip max_port_share_level for now since the frontend is not yet able to handle it
1179 if (key === "max_port_share_level") {
1180 continue;
1181 }
1182 const labelText = capitalize(key).replace("_", " ");
1183 await page.getByLabel(labelText, { exact: true }).fill(value);
1184 }
1185
1186 await page.getByRole("button", { name: /save/i }).click();
1187
1188 const name = templateSettingValues.name ?? templateName;
1189 await expectUrl(page).toHavePathNameEndingWith(`/${name}/docs`);
1190};
1191
1192export const updateWorkspace = async (
1193 page: Page,

Callers 1

Calls 1

capitalizeFunction · 0.85

Tested by

no test coverage detected