Skip to content

Instantly share code, notes, and snippets.

@kino6052
Last active February 28, 2021 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kino6052/1c120cd02e8a45cbaa2f802a58397f4e to your computer and use it in GitHub Desktop.
Save kino6052/1c120cd02e8a45cbaa2f802a58397f4e to your computer and use it in GitHub Desktop.
expect(reduce(['change', 'input-01', 'ball'], initialState)).toEqual({
input: "ball",
isInStockOnly: false,
products: [
{
id: "0",
category: "Sporting Goods",
price: "$49.99",
stocked: true,
name: "Football",
},
{
id: "1",
category: "Sporting Goods",
price: "$9.99",
stocked: true,
name: "Baseball",
},
{
id: "2",
category: "Sporting Goods",
price: "$29.99",
stocked: false,
name: "Basketball",
},
{
id: "3",
category: "Electronics",
price: "$99.99",
stocked: true,
name: "iPod Touch",
},
{
id: "4",
category: "Electronics",
price: "$399.99",
stocked: false,
name: "iPhone 5",
},
{
id: "5",
category: "Electronics",
price: "$199.99",
stocked: true,
name: "Nexus 7",
},
],
productsToDisplay: ["0", "1", "2"],
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment