Skip to content

fix: update workspace form fields when switching templates - #1761

Merged
Kira-Pilot merged 1 commit into
mainfrom
update-workspace-fields-on-template-switch/kira-pilot
May 26, 2022
Merged

Kira-Pilot merged 1 commit into
mainfrom
update-workspace-fields-on-template-switch/kira-pilot

Conversation

@Kira-Pilot

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

Copy link
Copy Markdown
Contributor

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