Browse Source

chore(core): Handle failing tests

Michael Bromley 5 years ago
parent
commit
52ecb33733

+ 0 - 7
packages/core/src/api/config/__snapshots__/graphql-custom-fields.spec.ts.snap

@@ -260,13 +260,6 @@ scalar DateTime
 "
 `;
 
-exports[`addOrderLineCustomFieldsInput() Does not modify schema when the addItemToOrder mutation not present 1`] = `
-"type Mutation {
-  createCustomer(id: ID!): Boolean
-}
-"
-`;
-
 exports[`addOrderLineCustomFieldsInput() Modifies the schema when the addItemToOrder & adjustOrderLine mutation is present 1`] = `
 "type Mutation {
   addItemToOrder(id: ID!, quantity: Int!, customFields: OrderLineCustomFieldsInput = null): Boolean

+ 0 - 14
packages/core/src/api/config/graphql-custom-fields.spec.ts

@@ -238,20 +238,6 @@ describe('addOrderLineCustomFieldsInput()', () => {
         const result = addOrderLineCustomFieldsInput(input, customFieldConfig);
         expect(printSchema(result)).toMatchSnapshot();
     });
-
-    it('Does not modify schema when the addItemToOrder mutation not present', () => {
-        const input = `
-            type Mutation {
-                createCustomer(id: ID!): Boolean
-            }
-        `;
-        const customFieldConfig: CustomFieldConfig[] = [
-            { name: 'giftWrap', type: 'boolean' },
-            { name: 'message', type: 'string' },
-        ];
-        const result = addOrderLineCustomFieldsInput(input, customFieldConfig);
-        expect(printSchema(result)).toMatchSnapshot();
-    });
 });
 
 describe('addRegisterCustomerCustomFieldsInput()', () => {

+ 7 - 1
packages/core/src/common/finite-state-machine/validate-transition-definition.spec.ts

@@ -24,7 +24,7 @@ describe('FSM validateTransitionDefinition()', () => {
                 to: ['ArrangingPayment', 'Cancelled'],
             },
             ArrangingPayment: {
-                to: ['PaymentAuthorized', 'PaymentSettled', 'AddingItems', 'Cancelled'],
+                to: ['PaymentAuthorized', 'PaymentSettled', 'AddingItems', 'Cancelled', 'Modifying'],
             },
             PaymentAuthorized: {
                 to: ['PaymentSettled', 'Cancelled'],
@@ -44,6 +44,12 @@ describe('FSM validateTransitionDefinition()', () => {
             Delivered: {
                 to: ['Cancelled'],
             },
+            ArrangingAdditionalPayment: {
+                to: ['ArrangingPayment'],
+            },
+            Modifying: {
+                to: ['ArrangingAdditionalPayment'],
+            },
             Cancelled: {
                 to: [],
             },