Skip to content

Commit

Permalink
Merge pull request #250 from Pinelab-studio/fix/picqer-e2e
Browse files Browse the repository at this point in the history
Fix/picqer e2e
  • Loading branch information
martijnvdbrug authored Aug 22, 2023
2 parents 38203ad + 148d320 commit 8f332e7
Show file tree
Hide file tree
Showing 32 changed files with 97 additions and 135 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.0.1",
"version": "independent",
"lerna": "2.0.0",
"npmClient": "yarn",
"useWorkspaces": true
Expand Down
43 changes: 22 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,32 @@
"lint:check": "yarn prettier --check . && yarn lint .",
"lint:fix": "yarn prettier --write . && yarn lint --fix .",
"upgrade:vendure": "yarn lerna exec --concurrency 1 \"yarn upgrade --pattern @vendure --latest\"",
"remove-node-modules": "find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +"
"remove-node-modules": "find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +",
"bump-all-versions": "lerna version --no-git-tag-version"
},
"devDependencies": {
"@graphql-codegen/cli": "2.6.2",
"@commitlint/cli": "17.2.0",
"@commitlint/config-conventional": "17.2.0",
"@graphql-codegen/typescript-document-nodes": "2.2.8",
"@google-cloud/storage": "5.18.2",
"@graphql-codegen/cli": "2.6.2",
"@graphql-codegen/typed-document-node": "^5.0.1",
"@graphql-codegen/typescript-document-nodes": "2.2.8",
"@graphql-codegen/typescript-operations": "2.3.5",
"@graphql-codegen/typescript": "2.4.8",
"@nestjs/cli": "8.2.4",
"@rollup/plugin-typescript": "11.0.0",
"@swc/core": "1.3.59",
"@types/adm-zip": "0.4.34",
"@types/sharp": "0.28.0",
"@types/tmp": "0.2.3",
"@typescript-eslint/eslint-plugin": "5.43.0",
"@vendure/admin-ui-plugin": "2.0.4",
"@vendure/core": "2.0.4",
"@vendure/testing": "2.0.4",
"@vendure/ui-devkit": "2.0.4",
"@vendure/email-plugin": "2.0.4",
"@vendure/admin-ui-plugin": "2.0.6",
"@vendure/asset-server-plugin": "2.0.6",
"@vendure/core": "2.0.6",
"@vendure/email-plugin": "2.0.6",
"@vendure/testing": "2.0.6",
"@vendure/ui-devkit": "2.0.6",
"aws-sdk": "2.1099.0",
"copyfiles": "2.4.1",
"eslint-config-prettier": "8.8.0",
"eslint-config-standard-with-typescript": "34.0.1",
Expand All @@ -43,25 +53,16 @@
"graphql-tag": "2.12.6",
"husky": "8.0.2",
"lerna": "6.0.3",
"nock": "13.2.4",
"nodemon": "2.0.15",
"prettier": "2.8.7",
"rimraf": "3.0.2",
"rollup": "3.19.0",
"ts-node": "10.7.0",
"typescript": "4.9.5",
"vitest": "0.30.1",
"@nestjs/cli": "8.2.4",
"@swc/core": "1.3.59",
"nock": "13.2.4",
"unplugin-swc": "1.3.2",
"@rollup/plugin-typescript": "11.0.0",
"@vendure/asset-server-plugin": "2.0.4",
"rollup": "3.19.0",
"wsdl-tsclient": "1.3.1",
"@types/sharp": "0.28.0",
"@types/tmp": "0.2.3",
"@google-cloud/storage": "5.18.2",
"@types/adm-zip": "0.4.34",
"aws-sdk": "2.1099.0"
"vitest": "0.30.1",
"wsdl-tsclient": "1.3.1"
},
"commitlint": {
"extends": [
Expand Down
5 changes: 2 additions & 3 deletions packages/test/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"name": "test-utils",
"version": "1.0.1",
"version": "1.0.2",
"main": "index.ts",
"license": "MIT",
"private": true,
"scripts": {
"generate": "graphql-codegen --config codegen.yml",
"start": "ts-node ./src/dev-server.ts",
"build": "tsc"
"start": "ts-node ./src/dev-server.ts"
}
}
9 changes: 2 additions & 7 deletions packages/util/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
{
"name": "utils",
"version": "1.0.1",
"version": "1.0.2",
"main": "index.ts",
"license": "MIT",
"private": true,
"devDependencies": {
"@vendure/common": "2.0.4",
"@vendure/core": "2.0.4",
"ts-node": "^10.9.1"
}
"private": true
}
2 changes: 1 addition & 1 deletion packages/vendure-order-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-order-client",
"version": "1.0.1",
"version": "1.0.2",
"description": "A tiny, framework agnostic client for managing active orders and checkout with Vendure.",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
2 changes: 1 addition & 1 deletion packages/vendure-plugin-admin-ui-helpers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-plugin-admin-ui-helpers",
"version": "1.0.1",
"version": "1.0.2",
"description": "Vendure plugin for various admin ui helpers. Cancel button, complete order button etc.",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
2 changes: 1 addition & 1 deletion packages/vendure-plugin-coinbase/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-plugin-coinbase",
"version": "1.0.1",
"version": "1.0.2",
"description": "Vendure plugin for Coinbase payments",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-plugin-customer-managed-groups",
"version": "1.0.1",
"version": "1.0.2",
"description": "This plugin allows customer groups to have 'Group admins', that are allowed to fetch placed orders for everyone in the group.",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
2 changes: 1 addition & 1 deletion packages/vendure-plugin-dutch-postalcode/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-plugin-dutch-postalcode",
"version": "1.0.1",
"version": "1.0.2",
"description": "Vendure plugin for retrieving Dutch addresses by postal code via postcode.tech",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
2 changes: 1 addition & 1 deletion packages/vendure-plugin-e-boekhouden/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-plugin-e-boekhouden",
"version": "1.0.1",
"version": "1.0.2",
"description": "Vendure plugin for integration with the e-boekhouden accounting platform",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
2 changes: 1 addition & 1 deletion packages/vendure-plugin-goedgepickt/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-plugin-goedgepickt",
"version": "1.0.1",
"version": "1.0.2",
"description": "Vendure plugin for integration with the Goedgepickt order picking platform",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
2 changes: 1 addition & 1 deletion packages/vendure-plugin-google-cloud-tasks/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-plugin-google-cloud-tasks",
"version": "1.1.0",
"version": "1.1.1",
"description": "Vendure plugin for using worker jobs with Google Cloud Tasks",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
2 changes: 1 addition & 1 deletion packages/vendure-plugin-google-storage-assets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-plugin-google-storage-assets",
"version": "1.0.1",
"version": "1.0.2",
"description": "Vendure plugin for uploading assets to Google storage",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
2 changes: 1 addition & 1 deletion packages/vendure-plugin-invoices/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-plugin-invoices",
"version": "1.1.1",
"version": "1.1.2",
"description": "Vendure plugin for invoice generation",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-plugin-limit-variant-per-order",
"version": "1.0.1",
"version": "1.0.2",
"description": "Vendure plugin to limit the amount of a specific product that can be ordered per order.",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
2 changes: 1 addition & 1 deletion packages/vendure-plugin-metrics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-plugin-metrics",
"version": "1.0.1",
"version": "1.0.2",
"description": "Vendure plugin measuring and visualizing e-commerce metrics",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-plugin-modify-customer-orders",
"version": "1.0.1",
"version": "1.0.2",
"description": "Vendure plugin for converting Active orders to Draft",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@pinelab/vendure-plugin-multiserver-db-sessioncache",
"description": "An implementation of Vendure's SessionCacheStrategy that caches session in the database",
"version": "1.0.1",
"version": "1.0.2",
"author": "Surafel Melese Tariku <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
"repository": "https://github.com/Pinelab-studio/pinelab-vendure-plugins",
Expand Down
2 changes: 1 addition & 1 deletion packages/vendure-plugin-myparcel/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-plugin-myparcel",
"version": "1.0.1",
"version": "1.0.2",
"description": "Vendure plugin for MyParcel fulfillment",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
2 changes: 1 addition & 1 deletion packages/vendure-plugin-order-export/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-plugin-order-export",
"version": "1.0.1",
"version": "1.0.2",
"description": "Vendure plugin for exporting orders to a file",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
2 changes: 1 addition & 1 deletion packages/vendure-plugin-picqer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-plugin-picqer",
"version": "1.0.4",
"version": "1.0.6",
"description": "Vendure plugin syncing to orders and stock with Picqer",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
8 changes: 4 additions & 4 deletions packages/vendure-plugin-picqer/src/api/picqer.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,15 @@ export class PicqerClient {
): Promise<ProductData> {
const product = await this.getProductByCode(sku);
if (!product) {
Logger.info(
`Product '${sku}' not found, creating new product`,
Logger.debug(
`Product '${sku}' not found, creating new product in Picqer`,
loggerCtx
);
return this.createProduct(input);
}
const productId = product.idproduct;
Logger.info(
`Existing product '${productId}' found, updating product ${productId}`,
Logger.debug(
`Existing product '${productId}' found, updating product ${productId} in Picqer`,
loggerCtx
);
return this.updateProduct(productId, input);
Expand Down
1 change: 1 addition & 0 deletions packages/vendure-plugin-picqer/src/api/picqer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export class PicqerService implements OnApplicationBootstrap {
loggerCtx
);
}
Logger.info(`Successfully handled job '${data.action}'`, loggerCtx);
} catch (e: unknown) {
if (e instanceof Error) {
// Only log a warning, because this is a background function that will be retried by the JobQueue
Expand Down
35 changes: 3 additions & 32 deletions packages/vendure-plugin-picqer/test/picqer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,7 @@ describe('Picqer plugin', function () {
});
});

// FIXME enable after fix: https://github.com/vendure-ecommerce/vendure/issues/2191
it.skip('Should update to "PartiallyDelivered" when 2 of 3 items are shipped', async () => {
it('Should update to "PartiallyDelivered" when 2 of 3 items are shipped', async () => {
const mockIncomingWebhook = {
event: 'picklists.closed',
data: {
Expand All @@ -272,17 +271,15 @@ describe('Picqer plugin', function () {
expect(order!.state).toBe('PartiallyDelivered');
});

// FIXME enable after fix: https://github.com/vendure-ecommerce/vendure/issues/2191
it.skip('Should have updated stock after 1 item was shipped', async () => {
it('Should have updated stock after 1 item was shipped', async () => {
const variant = (await getAllVariants(adminClient)).find(
(v) => v.id === 'T_1'
);
expect(variant!.stockOnHand).toBe(98);
expect(variant!.stockAllocated).toBe(1);
});

// FIXME enable after fix: https://github.com/vendure-ecommerce/vendure/issues/2191
it.skip('Should update to "Delivered" when 3 of 3 items are shipped', async () => {
it('Should update to "Delivered" when 3 of 3 items are shipped', async () => {
const mockIncomingWebhook = {
event: 'picklists.closed',
data: {
Expand All @@ -309,32 +306,6 @@ describe('Picqer plugin', function () {
expect(order!.state).toBe('Delivered');
});

// FIXME Delete this test after fix: https://github.com/vendure-ecommerce/vendure/issues/2191
it('Should update to "Delivered" when items are shipped', async () => {
const mockIncomingWebhook = {
event: 'picklists.closed',
data: {
reference: createdOrder?.code,
products: [{ productcode: 'L2201308', amountpicked: 3 }],
},
} as Partial<IncomingPicklistWebhook>;
await adminClient.fetch(
`http://localhost:3050/picqer/hooks/${E2E_DEFAULT_CHANNEL_TOKEN}`,
{
method: 'POST',
body: JSON.stringify(mockIncomingWebhook),
headers: {
'X-Picqer-Signature': createSignature(
mockIncomingWebhook,
'test-api-key'
),
},
}
);
const order = await getOrder(adminClient, createdOrder?.id as string);
expect(order!.state).toBe('Delivered');
});

it('Should have updated stock after all items are shipped', async () => {
const variant = (await getAllVariants(adminClient)).find(
(v) => v.id === 'T_1'
Expand Down
2 changes: 1 addition & 1 deletion packages/vendure-plugin-popularity-scores/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-plugin-popularity-scores",
"version": "1.0.1",
"version": "1.0.2",
"description": "Sort products and collections by popularity based on previously placed orders",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
2 changes: 1 addition & 1 deletion packages/vendure-plugin-sendcloud/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-plugin-sendcloud",
"version": "1.0.1",
"version": "1.0.2",
"description": "Vendure plugin for syncing orders with SendCloud",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-plugin-shipping-by-weight-and-country",
"version": "1.0.1",
"version": "1.0.2",
"description": "Vendure plugin for selecting a shipping method based on the total weight and the shipping address of an order.",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
2 changes: 1 addition & 1 deletion packages/vendure-plugin-stock-monitoring/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-plugin-stock-monitoring",
"version": "1.0.1",
"version": "1.0.2",
"description": "Vendure plugin for monitoring stock levels through a widget or by email",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
2 changes: 1 addition & 1 deletion packages/vendure-plugin-stripe-subscription/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-plugin-stripe-subscription",
"version": "1.3.0",
"version": "1.3.1",
"description": "Vendure plugin for selling subscriptions via Stripe",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
2 changes: 1 addition & 1 deletion packages/vendure-plugin-variant-bulk-update/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-plugin-variant-bulk-update",
"version": "1.0.1",
"version": "1.0.2",
"description": "Vendure plugin to bulk update all variants of a product",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
2 changes: 1 addition & 1 deletion packages/vendure-plugin-webhook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-plugin-webhook",
"version": "1.0.1",
"version": "1.0.2",
"description": "Call webhooks based on configured events from Vendure",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
Loading

0 comments on commit 8f332e7

Please sign in to comment.