Last active
June 25, 2018 08:58
-
-
Save timdeschryver/c98df63003cc40d2fc732b9b3e7a2005 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const testCases = [ | |
| { | |
| name: 'getProducts', | |
| selector: getProducts, | |
| state: createCatalogState(), | |
| }, | |
| { | |
| name: 'getProductSkus', | |
| selector: getProductSkus, | |
| state: createCatalogState(), | |
| }, | |
| { | |
| name: 'getCatalog', | |
| selector: getCatalog, | |
| state: createCatalogState(), | |
| }, | |
| { | |
| name: 'getCartItems', | |
| selector: getCartItems, | |
| state: createCartState(), | |
| }, | |
| { | |
| name: 'getAllCartSummary', | |
| selector: getAllCartSummary, | |
| state: createState(), | |
| }, | |
| { | |
| name: 'getCartSummary', | |
| selector: getCartSummary, | |
| state: createState(), | |
| }, | |
| ]; | |
| testCases.forEach(({name, state, selector}) => { | |
| test(`${name} with input ${JSON.stringify(state)}`, () => { | |
| expect(selector(state)).toMatchSnapshot(); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment