Skip to content

Commit

Permalink
fix: repair tests after commercetools SDK update
Browse files Browse the repository at this point in the history
  • Loading branch information
arnoerpenbeck committed Dec 12, 2024
1 parent 9c30c16 commit fe180e7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 33 deletions.
47 changes: 20 additions & 27 deletions event/src/order/testModels.ts
Original file line number Diff line number Diff line change
@@ -1,45 +1,38 @@
import {
Address,
BusinessUnitKeyReference,
CartDiscountReference,
CartOrigin,
CartReference,
CentPrecisionMoney,
LineItem,
Order as CommercetoolsOrder,
ShippingMethod,
} from '@commercetools/platform-sdk';
import {
CreatedBy,
LastModifiedBy,
TypedMoney,
} from '@commercetools/platform-sdk/dist/declarations/src/generated/models/common';
import { BusinessUnitKeyReference } from '@commercetools/platform-sdk/dist/declarations/src/generated/models/business-unit';
import { StoreKeyReference } from '@commercetools/platform-sdk/dist/declarations/src/generated/models/store';
import {
CartOrigin,
CartReference,
CustomerGroupReference,
CustomFields,
CustomLineItem,
DiscountCodeInfo,
InventoryMode,
LastModifiedBy,
LineItem,
OrderState,
PaymentInfo,
PaymentState,
QuoteReference,
ReturnInfo,
RoundingMode,
ShipmentState,
Shipping,
ShippingInfo,
ShippingMethod,
ShippingMode,
ShippingRateInput,
StateReference,
StoreKeyReference,
SyncInfo,
TaxCalculationMode,
TaxedPrice,
TaxMode,
} from '@commercetools/platform-sdk/dist/declarations/src/generated/models/cart';
import { CustomerGroupReference } from '@commercetools/platform-sdk/dist/declarations/src/generated/models/customer-group';
import { StateReference } from '@commercetools/platform-sdk/dist/declarations/src/generated/models/state';
import { QuoteReference } from '@commercetools/platform-sdk/dist/declarations/src/generated/models/quote';
import { CustomFields } from '@commercetools/platform-sdk/dist/declarations/src/generated/models/type';
import { CartDiscountReference } from '@commercetools/platform-sdk/dist/declarations/src/generated/models/cart-discount';
import {
OrderState,
PaymentInfo,
PaymentState,
ReturnInfo,
ShipmentState,
SyncInfo,
} from '@commercetools/platform-sdk/dist/declarations/src/generated/models/order';
} from '@commercetools/platform-sdk';
import { CUSTOM_TYPE_NAME } from 'shared';

const shippingMethodDHL: ShippingMethod = {
Expand Down Expand Up @@ -335,7 +328,7 @@ interface CommercetoolsOrderTemplate {
store?: StoreKeyReference;
lineItems: LineItem[];
customLineItems: CustomLineItem[];
totalPrice: TypedMoney;
totalPrice: CentPrecisionMoney;
taxedPrice?: TaxedPrice;
taxedShippingPrice?: TaxedPrice;
shippingAddress?: Address;
Expand Down
7 changes: 3 additions & 4 deletions event/tests/eventRouter.test.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import { describe, expect } from '@jest/globals';
import { beforeAll, describe, expect, it } from '@jest/globals';
import express, { Express } from 'express';
import request from 'supertest';

import { EventRouter } from '../src/routes/eventRouter';
import { FftApiClient } from '@fulfillmenttools/fulfillmenttools-sdk-typescript';
import { getTestClient } from 'shared';

describe('Event Router', () => {
let app: Express;
let router: EventRouter;
let fftApiClient: FftApiClient;

beforeAll(() => {
router = new EventRouter(fftApiClient);
router = new EventRouter(getTestClient());
app = express();
app.use(express.json());
app.use('/event', router.getRouter());
Expand Down
2 changes: 1 addition & 1 deletion event/tests/orderMapper.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect } from '@jest/globals';
import { afterAll, afterEach, beforeAll, describe, expect, it } from '@jest/globals';
import { OrderMapper } from '../src/order/orderMapper';
import {
getTestOrder,
Expand Down
2 changes: 1 addition & 1 deletion event/tests/orderProcessor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { OrderProcessor } from '../src/order/orderProcessor';
import { ResourceLockedError, FftOrderServiceMock } from 'shared';
import { OrderMapper } from '../src/order/orderMapper';

import { describe, expect } from '@jest/globals';
import { afterAll, afterEach, beforeAll, describe, expect, it, jest } from '@jest/globals';

import { server } from 'shared';

Expand Down

0 comments on commit fe180e7

Please sign in to comment.