From 910f7210887c70177cd595f84bd7952aa5020e22 Mon Sep 17 00:00:00 2001 From: Gabriel L Martinez Date: Tue, 14 Apr 2020 00:25:31 -0400 Subject: [PATCH] Add story to test not published list of products Update Stories Snapshot --- src/products/fixtures.ts | 10 +- .../__snapshots__/Stories.test.ts.snap | 1081 +++++++++++------ .../stories/products/ProductListPage.tsx | 6 + 3 files changed, 752 insertions(+), 345 deletions(-) diff --git a/src/products/fixtures.ts b/src/products/fixtures.ts index 0980e1be6..5f019f4dc 100644 --- a/src/products/fixtures.ts +++ b/src/products/fixtures.ts @@ -324,7 +324,7 @@ export const products = ( }, id: "UHJvZHVjdDo2NA==", isAvailable: true, - isPublished: true, + isPublished: false, name: "Light Speed Yellow Paint", productType: { __typename: "ProductType", @@ -346,7 +346,7 @@ export const products = ( }, id: "UHJvZHVjdDo2NQ==", isAvailable: true, - isPublished: true, + isPublished: false, name: "Hyperspace Turquoise Paint", productType: { __typename: "ProductType", @@ -568,7 +568,7 @@ export const products = ( }, id: "UHJvZHVjdDo3OQ==", isAvailable: true, - isPublished: true, + isPublished: false, name: "Bean Juice", productType: { __typename: "ProductType", @@ -864,7 +864,7 @@ export const products = ( }, id: "UHJvZHVjdDoxMTU=", isAvailable: true, - isPublished: true, + isPublished: false, name: "Black Hoodie", productType: { __typename: "ProductType", @@ -975,7 +975,7 @@ export const products = ( }, id: "UHJvZHVjdDo4NQ==", isAvailable: true, - isPublished: true, + isPublished: false, name: "Colored Parrot Cushion", productType: { __typename: "ProductType", diff --git a/src/storybook/__snapshots__/Stories.test.ts.snap b/src/storybook/__snapshots__/Stories.test.ts.snap index f9f970796..ce70250e2 100644 --- a/src/storybook/__snapshots__/Stories.test.ts.snap +++ b/src/storybook/__snapshots__/Stories.test.ts.snap @@ -110782,12 +110782,12 @@ exports[`Storyshots Views / Products / Product list default 1`] = `
- Published + Not published
- Published + Not published
- Published + Not published
- Published + Not published
- Published + Not published
`; +exports[`Storyshots Views / Products / Product list not published 1`] = ` +
+
+
+
+ Products +
+
+
+
+ +
+ +
+
+
+
+
+
+
+ + +
+
+
+
+
+ +
+
+
+ + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+
+ + Name + +
+ +
+
+
+
+ Type +
+
+
+
+
+ Published +
+
+
+
+
+ Price +
+
+
+
+
+
+
+
+`; + exports[`Storyshots Views / Products / Product list published 1`] = `
- - - - - -
-
- -
-
- Light Speed Yellow Paint -
-
- - - Paint - - -
- Published -
- - - $15.00 - - - - - - - -
-
- -
-
- Hyperspace Turquoise Paint -
-
- - - Paint - - -
- Published -
- - - $15.00 - - - - - - - -
-
- -
-
- Bean Juice -
-
- - - Juice - - -
- Published -
- - - $3.00 - - - - - - - -
-
- -
-
- Black Hoodie -
-
- - - Top (clothing) - - -
- Published -
- - - $30.00 - - - - - - - -
-
- -
-
- Colored Parrot Cushion -
-
- - - Cushion - - -
- Published -
- - - $20.00 - -
diff --git a/src/storybook/stories/products/ProductListPage.tsx b/src/storybook/stories/products/ProductListPage.tsx index b8f3f22a6..98ba42fd4 100644 --- a/src/storybook/stories/products/ProductListPage.tsx +++ b/src/storybook/stories/products/ProductListPage.tsx @@ -64,4 +64,10 @@ storiesOf("Views / Products / Product list", module) products={products.filter(product => product.isPublished)} /> )) + .add("not published", () => ( + !product.isPublished)} + /> + )) .add("no data", () => );