mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
Fixes #38 This adds a create-workspace form (with only 1 field, probably the simplest form ever 😄 )  It currently redirects to a path `/workspaces/<unique id>`, but that isn't implemented yet - but you can see the workspace show up on the projects page.
21 lines
670 B
TypeScript
21 lines
670 B
TypeScript
import { render, screen } from "@testing-library/react"
|
|
import React from "react"
|
|
import { CreateWorkspaceForm } from "./CreateWorkspaceForm"
|
|
import { MockProject, MockWorkspace } from "./../test_helpers"
|
|
|
|
describe("CreateWorkspaceForm", () => {
|
|
it("renders", async () => {
|
|
// Given
|
|
const onSubmit = () => Promise.resolve(MockWorkspace)
|
|
const onCancel = () => Promise.resolve()
|
|
|
|
// When
|
|
render(<CreateWorkspaceForm project={MockProject} onSubmit={onSubmit} onCancel={onCancel} />)
|
|
|
|
// Then
|
|
// Simple smoke test to verify form renders
|
|
const element = await screen.findByText("Create Workspace")
|
|
expect(element).toBeDefined()
|
|
})
|
|
})
|