metasfresh-webui-frontend-legacy icon indicating copy to clipboard operation
metasfresh-webui-frontend-legacy copied to clipboard

Add unit tests for Table and child components

Open siemiatj opened this issue 5 years ago • 1 comments

Is this a bug or feature request?

Feature

What is the current behavior?

Which are the steps to reproduce?

What is the expected or desired behavior?

We need more tests with the coming navigation changes.

siemiatj avatar May 05 '19 22:05 siemiatj

@siemiatj Please have a look over the file Table.test.js on dev-2156 branch.

I have tried to create a Table component inside a Tab component with dummy props. But when I try to run the test it does fail with the following error: Invariant Violation: Could not find "store" in either the context or props of "Connect(TableFilter)". Either wrap the root component in a <Provider>, or explicitly pass "store" as a prop to "Connect(TableFilter)".

And I don't understand why? because TableFilter is a child component of Table and if we use shallow rendering it should not care about it? Or in this case it does, but why?

ionut-movila avatar Jun 04 '19 15:06 ionut-movila