---
title: "Comment by Satyam Tyagi on \"How to test a select element with React Testing Library\" | Hashnode"
description: "Getting error in -&gt; ● should allow user to change country. FAIL src / components / App.test.js ● should allow user to change country expect(received).toBe(ex"
url: "https://hashnode.com/posts/how-to-test-a-select-element-with-react-testing-library/615deda08e8734462af5b4a6/comment/62926b7ed97f80b5091d9dec"
---

[Discussion](https://hashnode.com/posts/how-to-test-a-select-element-with-react-testing-library/615deda08e8734462af5b4a6)

Comment [How to test a select element with React Testing Library](https://hashnode.com/posts/how-to-test-a-select-element-with-react-testing-library/615deda08e8734462af5b4a6)

[Satyam Tyagi](https://hashnode.com/@satyam305)

[May 28, 2022](https://hashnode.com/posts/how-to-test-a-select-element-with-react-testing-library/615deda08e8734462af5b4a6/comment/62926b7ed97f80b5091d9dec)

Getting error in -> ● should allow user to change country.

```
 FAIL  src/components/App.test.js
  ● should allow user to change country

    expect(received).toBe(expected) // Object.is equality

    Expected: true
    Received: false

      27 |     screen.getByRole('option', {name: 'Ireland'}),
      28 |   )
    > 29 |   expect(screen.getByRole('option', {name: 'Ireland'}).selected).toBe(true)
         |                                                                  ^
      30 | })
      31 |
```

[Cathal Mac Donnacha](https://hashnode.com/@cathalmacdonnacha)

[May 30, 2022](https://hashnode.com/posts/how-to-test-a-select-element-with-react-testing-library/615deda08e8734462af5b4a6/comment/62926b7ed97f80b5091d9dec#reply-6294b56a22c65adc00272426)

Hey, is this in the codesandbox test? Seems to be working fine for me.
