Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update workspace form fields when switching templates #1761

Merged

Conversation

Kira-Pilot
Copy link
Member

@Kira-Pilot Kira-Pilot commented May 25, 2022

resolves #1716

The fix took 10 minutes; trying to write a test took a lot longer and I finally gave up. How the heck do you switch the input in an MUI TextField?

Given a TextField with inputProps={{ "data-testid": "template-select" }}

Something like:

renderWithAuth(<CreateWorkspacePage />, {
  route: "/workspaces/new",
  path: "/workspaces/new",
})

const field = await screen.findByTestId("template-select")
expect(field).toBeInTheDocument()

fireEvent.change(field, { target: { value: MockTemplate.id } })
expect(field.value).toBe(MockTemplate.id)

seems to work - everything passes - but schema description text just doesn't show up, even with everything mocked out.
Also, is there a reason we aren't using MUI Select? IDK if that would make this any easier; just curious.

@Kira-Pilot Kira-Pilot requested a review from a team as a code owner May 25, 2022 20:44
@Kira-Pilot Kira-Pilot merged commit 9a70c34 into main May 26, 2022
@Kira-Pilot Kira-Pilot deleted the update-workspace-fields-on-template-switch/kira-pilot branch May 26, 2022 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: create workspace form fields don't update when you switch templates
2 participants