diff --git a/src/products/components/ProductVariantCreateDialog/__snapshots__/reducer.test.ts.snap b/src/products/components/ProductVariantCreateDialog/__snapshots__/reducer.test.ts.snap index f9b455627..22a84acfc 100644 --- a/src/products/components/ProductVariantCreateDialog/__snapshots__/reducer.test.ts.snap +++ b/src/products/components/ProductVariantCreateDialog/__snapshots__/reducer.test.ts.snap @@ -28,39 +28,7 @@ Object { "price": Object { "all": true, "attribute": undefined, - "value": "", - "values": Array [], - }, - "stock": Object { - "all": true, - "attribute": undefined, - "value": "", - "values": Array [], - }, - "variants": Array [], -} -`; - -exports[`Reducer is able to select attributes 1`] = ` -Object { - "attributes": Array [ - Object { - "id": "attr-1", - "values": Array [], - }, - Object { - "id": "attr-2", - "values": Array [], - }, - Object { - "id": "attr-4", - "values": Array [], - }, - ], - "price": Object { - "all": true, - "attribute": undefined, - "value": "", + "value": "10.99", "values": Array [], }, "stock": Object { @@ -343,7 +311,7 @@ Object { "price": Object { "all": false, "attribute": "attr-1", - "value": "", + "value": "10.99", "values": Array [ Object { "slug": "val-1-1", @@ -594,7 +562,7 @@ Object { "price": Object { "all": true, "attribute": undefined, - "value": "", + "value": "10.99", "values": Array [], }, "stock": Object { @@ -625,7 +593,7 @@ Object { ], }, ], - "priceOverride": "", + "priceOverride": "10.99", "quantity": 45, "sku": "", }, @@ -650,7 +618,7 @@ Object { ], }, ], - "priceOverride": "", + "priceOverride": "10.99", "quantity": 45, "sku": "", }, @@ -675,7 +643,7 @@ Object { ], }, ], - "priceOverride": "", + "priceOverride": "10.99", "quantity": 45, "sku": "", }, @@ -700,7 +668,7 @@ Object { ], }, ], - "priceOverride": "", + "priceOverride": "10.99", "quantity": 45, "sku": "", }, @@ -725,7 +693,7 @@ Object { ], }, ], - "priceOverride": "", + "priceOverride": "10.99", "quantity": 45, "sku": "", }, @@ -750,7 +718,7 @@ Object { ], }, ], - "priceOverride": "", + "priceOverride": "10.99", "quantity": 45, "sku": "", }, @@ -775,7 +743,7 @@ Object { ], }, ], - "priceOverride": "", + "priceOverride": "10.99", "quantity": 45, "sku": "", }, @@ -800,7 +768,7 @@ Object { ], }, ], - "priceOverride": "", + "priceOverride": "10.99", "quantity": 45, "sku": "", }, @@ -836,7 +804,7 @@ Object { "price": Object { "all": true, "attribute": undefined, - "value": "", + "value": "10.99", "values": Array [], }, "stock": Object { @@ -876,7 +844,7 @@ Object { ], }, ], - "priceOverride": "", + "priceOverride": "10.99", "quantity": 13, "sku": "", }, @@ -901,7 +869,7 @@ Object { ], }, ], - "priceOverride": "", + "priceOverride": "10.99", "quantity": 13, "sku": "", }, @@ -926,7 +894,7 @@ Object { ], }, ], - "priceOverride": "", + "priceOverride": "10.99", "quantity": 13, "sku": "", }, @@ -951,7 +919,7 @@ Object { ], }, ], - "priceOverride": "", + "priceOverride": "10.99", "quantity": 13, "sku": "", }, @@ -976,7 +944,7 @@ Object { ], }, ], - "priceOverride": "", + "priceOverride": "10.99", "quantity": 19, "sku": "", }, @@ -1001,7 +969,7 @@ Object { ], }, ], - "priceOverride": "", + "priceOverride": "10.99", "quantity": 19, "sku": "", }, @@ -1026,7 +994,7 @@ Object { ], }, ], - "priceOverride": "", + "priceOverride": "10.99", "quantity": 19, "sku": "", }, @@ -1051,7 +1019,7 @@ Object { ], }, ], - "priceOverride": "", + "priceOverride": "10.99", "quantity": 19, "sku": "", }, diff --git a/src/products/components/ProductVariantCreateDialog/fixtures.ts b/src/products/components/ProductVariantCreateDialog/fixtures.ts index e53aa0aca..5cc1b3ce2 100644 --- a/src/products/components/ProductVariantCreateDialog/fixtures.ts +++ b/src/products/components/ProductVariantCreateDialog/fixtures.ts @@ -1,7 +1,7 @@ import { createVariants } from "./createVariants"; import { AllOrAttribute, - initialForm, + createInitialForm, ProductVariantCreateFormData } from "./form"; @@ -33,7 +33,7 @@ export const attributes = [ ]; export const secondStep: ProductVariantCreateFormData = { - ...initialForm, + ...createInitialForm([], "10.99"), attributes: [ { id: attributes[0].id, diff --git a/src/products/components/ProductVariantCreateDialog/reducer.test.ts b/src/products/components/ProductVariantCreateDialog/reducer.test.ts index 39fd9395d..9a224af0f 100644 --- a/src/products/components/ProductVariantCreateDialog/reducer.test.ts +++ b/src/products/components/ProductVariantCreateDialog/reducer.test.ts @@ -1,5 +1,4 @@ import { attributes, fourthStep, secondStep, thirdStep } from "./fixtures"; -import { initialForm } from "./form"; import reducer, { VariantField } from "./reducer"; function execActions( @@ -11,26 +10,6 @@ function execActions( } describe("Reducer is able to", () => { - it("select attributes", () => { - const state = execActions(initialForm, reducer, [ - { - attributeId: attributes[0].id, - type: "selectAttribute" - }, - { - attributeId: attributes[1].id, - type: "selectAttribute" - }, - { - attributeId: attributes[3].id, - type: "selectAttribute" - } - ]); - - expect(state.attributes).toHaveLength(3); - expect(state).toMatchSnapshot(); - }); - it("select attribute values", () => { const state = execActions(secondStep, reducer, [ { diff --git a/src/storybook/__snapshots__/Stories.test.ts.snap b/src/storybook/__snapshots__/Stories.test.ts.snap index a1f38c0cc..8d328b28d 100644 --- a/src/storybook/__snapshots__/Stories.test.ts.snap +++ b/src/storybook/__snapshots__/Stories.test.ts.snap @@ -82066,15 +82066,6 @@ exports[`Storyshots Views / Products / Create multiple variants / summary defaul
-
- - Choose Attributes - -
@@ -82778,15 +82769,6 @@ exports[`Storyshots Views / Products / Create multiple variants / summary errors
-
- - Choose Attributes - -
@@ -83495,15 +83477,6 @@ exports[`Storyshots Views / Products / Create multiple variants choose attribute
-
- - Choose Attributes - -
@@ -83534,304 +83507,7 @@ exports[`Storyshots Views / Products / Create multiple variants choose attribute
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - Author -
- - - Box Size -
- - - Brand -
- - - Candy Box Size -
- - - Coffee Genre -
- - - Collar -
- - - Color -
- - - Cover -
- - - Flavor -
- - - Language -
- - - Publisher -
- - - Size -
-
+ />
@@ -83859,15 +83535,6 @@ exports[`Storyshots Views / Products / Create multiple variants prices and SKU 1
-
- - Choose Attributes - -
@@ -84418,15 +84085,6 @@ exports[`Storyshots Views / Products / Create multiple variants select values 1`
-
- - Choose Attributes - -