question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

reactabular-select - Add basic tests

See original GitHub issue

Test plan:

byArrowKeys:

  • Up arrow pressed, no selectedRowIndex provided -> nothing should happen.
  • Down arrow pressed, no selectedRowIndex provided -> nothing should happen.
  • Up arrow pressed, selectedRowIndex provided and it’s larger than zero -> onSelectRow should get called with selectedRowIndex - 1.
  • Down arrow pressed, no selectedRowIndex provided and it’s smaller than rows length - 1 -> onSelectRow should get called with selectedRowIndex + 1.

selectRow:

  • Assuming rows contains selected flags and isSelected does not match any, all selected flags should become false.
  • If isSelected matches a row, the resulting rows should have matching ones with the selected flag set as true. selectRow should also return selectedRows within an array (currently it returns just the last selectedRow!).

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:20 (20 by maintainers)

github_iconTop GitHub Comments

1reaction
bebrawcommented, Oct 30, 2016

Moved to selectabular. Closing.

I’ll probably remove selection bits from reactabular in the next major release and rewrite documentation accordingly.

0reactions
git-tonicommented, Oct 24, 2016

Yup I was referring exactly at that basic config: jest + babel + eslint. I’m usually more on the side of ava/tape for tests, must confess I’m quite liking Jest 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to test a select element with React Testing Library
Learn how to test a select/dropdown element with React Testing Library. We focus on writing tests the way a real user would interact...
Read more >
Testing a Custom Select with React Testing Library
A large number of projects need a custom select. At first sight, they seem simple components, but in reality, they are quite complex....
Read more >
Testing React Select component - Stack Overflow
I would like to use React-Select react component, but I need to add tests. I've tried several options I found with google, but...
Read more >
rezamt/reactable: Testing react-table - GitHub
This project was bootstrapped with Create React App. Below you will find some information on how to perform common tasks.
Read more >
Building and Testing a Select Component - Debbie O'Brien
Building a Select component with a Composition to see the component render in isolation as well as Tests using React Testing Library to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found