Skip to content

Commit

Permalink
add test for ytunnus disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
pitkni committed Sep 21, 2023
1 parent 5c20927 commit ac138cc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/domain/hanke/edit/HankeForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ describe('HankeForm', () => {
await user.click(screen.getByText(/lisää rakennuttaja/i));
expect(screen.getAllByText('Rakennuttaja')).toHaveLength(1);

await user.click(screen.getAllByRole('button', { name: /tyyppi/i })[1]);
await user.click(screen.getByText(/yksityishenkilö/i));
expect(screen.getAllByLabelText(/y-tunnus/i)[1]).toBeDisabled();

await user.click(screen.getAllByText(/lisää yhteyshenkilö/i)[1]);
await user.click(screen.getAllByText(/lisää yhteyshenkilö/i)[1]);
expect(screen.getAllByRole('tablist')[1].childElementCount).toBe(2); // many contacts can be added
Expand Down

0 comments on commit ac138cc

Please sign in to comment.