MCPcopy Create free account
hub / github.com/coder/mux / openProjectCreationView

Function openProjectCreationView

tests/ui/helpers.ts:172–200  ·  view source on GitHub ↗
(
  view: RenderedApp,
  projectPath: string
)

Source from the content-addressed store, hash-verified

170 * Tests that need the creation UI must explicitly open the project page.
171 */
172export async function openProjectCreationView(
173 view: RenderedApp,
174 projectPath: string
175): Promise<void> {
176 await view.waitForReady();
177
178 const projectRow = await waitFor(
179 () => {
180 const el = view.container.querySelector(
181 `[data-project-path="${projectPath}"][aria-controls]`
182 ) as HTMLElement | null;
183 if (!el) throw new Error("Project not found in sidebar");
184 return el;
185 },
186 { timeout: 10_000 }
187 );
188
189 fireEvent.click(projectRow);
190
191 await waitFor(
192 () => {
193 const textarea = view.container.querySelector("textarea");
194 if (!textarea) {
195 throw new Error("Project creation page not rendered");
196 }
197 },
198 { timeout: 10_000 }
199 );
200}
201
202/**
203 * Add a project through the sidebar modal.

Callers 7

initBanner.test.tsFile · 0.90
lifecycle.test.tsFile · 0.90
createCreationHarnessFunction · 0.90
docker.test.tsFile · 0.90
setupCreationViewFunction · 0.90
picker.test.tsFile · 0.90

Calls 2

waitForReadyMethod · 0.80
waitForFunction · 0.50

Tested by 2

createCreationHarnessFunction · 0.72
setupCreationViewFunction · 0.72