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

Switch component test error #85

Closed
raducristianpopa opened this issue Jan 19, 2024 · 1 comment
Closed

Switch component test error #85

raducristianpopa opened this issue Jan 19, 2024 · 1 comment
Labels
area: tests Improvements or additions to tests

Comments

@raducristianpopa
Copy link
Member

console.error
      Warning: You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.
          at input
          at label
          at Switch (/Users/radu/dev/web-monetization-extension/packages/extension/src/components/switch.tsx:39:9)

      31 |
      32 |   it('forwards checked prop to input element', () => {
    > 33 |     render(<Switch checked />)
         |           ^
      34 |     const inputElement = screen.getByRole('switch')
      35 |     expect(inputElement).toBeChecked()
      36 |   })
@ionutanin
Copy link
Contributor

ionutanin commented Feb 19, 2024

@devcer thanks for raising this 👍
I've noticed the test error too and added a default value in the props here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: tests Improvements or additions to tests
Projects
Status: Done
2 participants