+
Skip to content

00 fulfillment base #6610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 96 commits into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
da2100d
feat: initial commit fulfillment base
sujithvn Nov 1, 2022
5848903
feat: initial commit fulfillment base
sujithvn Oct 17, 2022
b57ea4a
Merge remote-tracking branch 'origin/01-fulfillment-base' into 01-ful…
sujithvn Oct 18, 2022
0de0992
fix: pnpm-lock
sujithvn Oct 18, 2022
18c9870
fix: to generate function name in camel-case
sujithvn Oct 19, 2022
3a2fa08
feat: createFFType test
sujithvn Oct 24, 2022
4acb9e1
feat: ff-type tests
sujithvn Oct 24, 2022
b5edb37
fix: review comment fixes
sujithvn Oct 26, 2022
ebd684c
fix: removed string concatenation logic
sujithvn Oct 27, 2022
3ecab7d
fix: use queries.getCartById delete /util version
sujithvn Oct 28, 2022
fd9d72c
fix: fixed broken test
sujithvn Oct 31, 2022
5a09c25
feat: fulfillment type pickup and method store
sujithvn Oct 19, 2022
5dbcb91
fix: review comments fixes
sujithvn Oct 27, 2022
ef301ba
fix: import fix
sujithvn Oct 29, 2022
d202e97
fix: pnpm-lock update without snyk
sujithvn Nov 3, 2022
e0c056e
feat: fftype-shipping with methods flatrate ups
sujithvn Oct 18, 2022
d5252f5
fix: updated test cases
sujithvn Oct 19, 2022
3156bae
fix: filename fixed
sujithvn Oct 24, 2022
0c30b61
fix: review comment fixes
sujithvn Oct 27, 2022
2d9044d
fix: picked up the fix #6578 from old plugin
sujithvn Nov 3, 2022
37e3dd6
fix: renamed collection in test.js
sujithvn Oct 28, 2022
70bb0b9
fix: import fix
sujithvn Oct 29, 2022
975ea93
fix: renamed top-level folder ups to dynamic-rate
sujithvn Oct 29, 2022
2d543a3
fix: pnpm-lock without snyk
sujithvn Nov 3, 2022
2da2803
feat: changes related to carts plugin
sujithvn Oct 20, 2022
d2d37ec
feat: changes related to catalogs plugin
sujithvn Oct 20, 2022
b455518
feat: changes related to orders plugin
sujithvn Oct 20, 2022
d8f2465
feat: changes related to products plugin
sujithvn Oct 20, 2022
25a91b6
feat: integration test updates
sujithvn Oct 20, 2022
7314195
feat: switch from old shipments to fulfillment
sujithvn Nov 3, 2022
b047c03
feat: test setFulfillmentTypeForItems
sujithvn Oct 24, 2022
0ddcaa4
fix: package and plugin.json update
sujithvn Oct 29, 2022
d88a878
fix: review comment combine destructure
sujithvn Nov 3, 2022
1cdfafe
feat: new validateOrder and placeOrder refactor
sujithvn Oct 20, 2022
0520273
feat: first set of tests placeOrder refactor
sujithvn Oct 25, 2022
07c5436
fix: review comments fixes
sujithvn Oct 27, 2022
adf38b0
fix: export getCartById as query
sujithvn Nov 3, 2022
867434c
fix: pnpm-lock update without snyk
sujithvn Nov 3, 2022
79eac5e
feat: data migration for fulfillment feature
sujithvn Nov 4, 2022
c5ab64e
feat: migrate shopsetting for default ff-type
sujithvn Oct 4, 2022
a6356cb
fix: migration script fix
sujithvn Oct 6, 2022
3d016d7
fix: review comment fixes
sujithvn Oct 13, 2022
3acaeb4
fix: typo in 2.js
sujithvn Oct 13, 2022
bc2974d
fix: review comment fixes2
sujithvn Nov 7, 2022
3404407
fix: pnpm-lock without snyk
sujithvn Nov 7, 2022
278c8d4
fix: review comment fixes 1
sujithvn Nov 10, 2022
346460d
fix: review comment fixes 2
sujithvn Nov 15, 2022
da70978
fix: review comment fix 3
sujithvn Nov 15, 2022
5deec1c
fix: fix validatePermission
sujithvn Nov 16, 2022
7dfa566
fix: fix validatePermissions
sujithvn Nov 16, 2022
6e1c711
fix: review comment fixes
sujithvn Nov 17, 2022
ddca358
fix: review comment fixes
sujithvn Nov 17, 2022
3862d7b
fix: review comment fixes
sujithvn Nov 21, 2022
1e21608
fix: review comment fixes
sujithvn Mar 10, 2023
c774be7
Merge branch 'feat/fulfillment-types' into 00-fulfillment-base
sujithvn Mar 10, 2023
37536fa
fix: test errors and pnpm-lock
sujithvn Mar 10, 2023
7ed401f
Merge 00-fulfillment-base into new-fulfillment-type-shipping
sujithvn Mar 10, 2023
9f16175
fix: review comment updates
sujithvn Mar 10, 2023
e9497a0
Merge 00-fulfillment-base into new-fulfillment-type-pickup
sujithvn Mar 10, 2023
22b0c79
fix: unit test fix
sujithvn Mar 10, 2023
24a3202
fix: review comments
sujithvn Mar 10, 2023
edaa82b
fix: review comment updates
sujithvn Mar 10, 2023
13caba9
Merge branch 'feat/fulfillment-types' into new-fulfillment-impacted-p…
sujithvn Mar 10, 2023
61bc0a3
fix: unit test update
sujithvn Mar 11, 2023
3e6b7d2
fix: variable reuse
sujithvn Mar 12, 2023
a2bc593
Merge branch '00-fulfillment-base' into new-fulfillment-impacted-plugins
sujithvn Mar 13, 2023
bf821f7
Merge branch 'new-fulfillment-type-shipping' into new-fulfillment-imp…
sujithvn Mar 13, 2023
1e8b011
Merge fulfillment-pickup into impacted plugins
sujithvn Mar 13, 2023
a1cfcd7
fix: integration test updates
sujithvn Mar 13, 2023
1d94aa6
fix: filename case change
sujithvn Mar 13, 2023
059e4f0
fix: filename case 2
sujithvn Mar 13, 2023
ff3d042
Merge branch '00-fulfillment-base' into new-placeOrder-refactor-valid…
sujithvn Mar 13, 2023
3806ed8
Merge branch 'new-fulfillment-type-shipping' into new-placeOrder-refa…
sujithvn Mar 13, 2023
e7b3d23
Merge branch 'new-fulfillment-type-pickup' into new-placeOrder-refact…
sujithvn Mar 13, 2023
0117580
fix: pnpm-lock merge
sujithvn Mar 13, 2023
68d8313
Merge branch 'new-fulfillment-impacted-plugins' into new-placeOrder-r…
sujithvn Mar 13, 2023
8cf2151
fix: failing test fixes
sujithvn Mar 13, 2023
17909c3
fix: missed out review comment
sujithvn Mar 13, 2023
141145c
Merge pull request #6613 from reactioncommerce/new-fulfillment-type-p…
sujithvn May 18, 2023
c7a719d
Merge branch '00-fulfillment-base' of github.com:reactioncommerce/rea…
sujithvn May 18, 2023
f790476
Merge branch '00-fulfillment-base' into new-fulfillment-type-shipping
sujithvn May 18, 2023
fe15a55
fix: fixed test errors
sujithvn May 18, 2023
97946d6
Merge pull request #6614 from reactioncommerce/new-fulfillment-type-s…
sujithvn May 18, 2023
bf77d11
Merge branch '00-fulfillment-base' of github.com:reactioncommerce/rea…
sujithvn May 18, 2023
761bd13
Merge branch '00-fulfillment-base' into new-fulfillment-impacted-plugins
sujithvn May 18, 2023
5fed7d5
Merge pull request #6615 from reactioncommerce/new-fulfillment-impact…
sujithvn May 18, 2023
258e551
Merge branch '00-fulfillment-base' of github.com:reactioncommerce/rea…
sujithvn May 18, 2023
5b36b12
Merge branch '00-fulfillment-base' into new-placeOrder-refactor-valid…
sujithvn May 18, 2023
344bbf6
Merge pull request #6616 from reactioncommerce/new-placeOrder-refacto…
sujithvn May 18, 2023
1b09f81
Merge branch '00-fulfillment-base' of github.com:reactioncommerce/rea…
sujithvn May 18, 2023
9193072
Merge branch '00-fulfillment-base' into new-data-migration-fulfillment
sujithvn May 18, 2023
13bab48
fix: linter error
sujithvn May 18, 2023
1ec99f9
Merge pull request #6633 from reactioncommerce/new-data-migration-ful…
sujithvn May 18, 2023
ddff28d
Merge branch '00-fulfillment-base' of github.com:reactioncommerce/rea…
sujithvn May 18, 2023
df5ed5e
fix: changes picked from closed pr 6543
sujithvn May 18, 2023
7503a64
fix: picked chgs from closed pr 6545
sujithvn May 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions apps/reaction/jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ const externalNodeModules = [
"@reactioncommerce/api-plugin-pricing-simple",
"@reactioncommerce/api-plugin-products",
"@reactioncommerce/api-plugin-settings",
"@reactioncommerce/api-plugin-shipments-flat-rate",
"@reactioncommerce/api-plugin-shipments",
"@reactioncommerce/api-plugin-fulfillment",
"@reactioncommerce/api-plugin-fulfillment-type-shipping",
"@reactioncommerce/api-plugin-fulfillment-type-pickup",
"@reactioncommerce/api-plugin-fulfillment-method-shipping-flat-rate",
"@reactioncommerce/api-plugin-fulfillment-method-shipping-dynamic-rate",
"@reactioncommerce/api-plugin-fulfillment-method-pickup-store",
"@reactioncommerce/api-plugin-shops",
"@reactioncommerce/api-plugin-simple-schema",
"@reactioncommerce/api-plugin-sitemap-generator",
Expand Down
8 changes: 6 additions & 2 deletions apps/reaction/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
"@reactioncommerce/api-plugin-email-smtp": "1.0.8",
"@reactioncommerce/api-plugin-email-templates": "1.1.7",
"@reactioncommerce/api-plugin-files": "1.1.0",
"@reactioncommerce/api-plugin-fulfillment": "1.0.0",
"@reactioncommerce/api-plugin-fulfillment-type-shipping": "1.0.0",
"@reactioncommerce/api-plugin-fulfillment-type-pickup": "1.0.0",
"@reactioncommerce/api-plugin-fulfillment-method-shipping-flat-rate": "1.0.0",
"@reactioncommerce/api-plugin-fulfillment-method-shipping-dynamic-rate": "1.0.0",
"@reactioncommerce/api-plugin-fulfillment-method-pickup-store": "1.0.0",
"@reactioncommerce/api-plugin-i18n": "1.0.6",
"@reactioncommerce/api-plugin-inventory": "1.0.5",
"@reactioncommerce/api-plugin-inventory-simple": "1.0.6",
Expand All @@ -50,8 +56,6 @@
"@reactioncommerce/api-plugin-pricing-simple": "1.0.7",
"@reactioncommerce/api-plugin-products": "1.3.1",
"@reactioncommerce/api-plugin-settings": "1.0.7",
"@reactioncommerce/api-plugin-shipments": "1.0.3",
"@reactioncommerce/api-plugin-shipments-flat-rate": "1.0.10",
"@reactioncommerce/api-plugin-shops": "1.3.0",
"@reactioncommerce/api-plugin-simple-schema": "1.0.3",
"@reactioncommerce/api-plugin-sitemap-generator": "1.2.3",
Expand Down
8 changes: 6 additions & 2 deletions apps/reaction/plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@
"discounts": "@reactioncommerce/api-plugin-discounts",
"discountCodes": "@reactioncommerce/api-plugin-discounts-codes",
"surcharges": "@reactioncommerce/api-plugin-surcharges",
"shipments": "@reactioncommerce/api-plugin-shipments",
"shipmentsFlatRate": "@reactioncommerce/api-plugin-shipments-flat-rate",
"fulfillment": "@reactioncommerce/api-plugin-fulfillment",
"fulfillmentTypeShipping": "@reactioncommerce/api-plugin-fulfillment-type-shipping",
"fulfillmentTypePickup": "@reactioncommerce/api-plugin-fulfillment-type-pickup",
"fulfillmentMethodShippingFlatRate": "@reactioncommerce/api-plugin-fulfillment-method-shipping-flat-rate",
"fulfillmentMethodShippingDynamicRate": "@reactioncommerce/api-plugin-fulfillment-method-shipping-dynamic-rate",
"fulfillmentMethodPickupStore": "@reactioncommerce/api-plugin-fulfillment-method-pickup-store",
"taxes": "@reactioncommerce/api-plugin-taxes",
"taxesFlatRate": "@reactioncommerce/api-plugin-taxes-flat-rate",
"navigation": "@reactioncommerce/api-plugin-navigation",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,37 @@ const mockShipmentMethod = {
handling: 0,
label: "mockLabel",
name: "mockName",
fulfillmentMethod: "flatRate",
rate: 3.99
};

const mockFulfillmentEntry = {
_id: "mockShippingMethod",
name: "Default Shipping Provider",
provider: {
enabled: true,
label: "Flat Rate",
name: "flatRates"
},
fulfillmentType: "shipping",
methods: [
{
cost: 2.5,
fulfillmentTypes: [
"shipping"
],
fulfillmentMethod: "flatRate",
group: "Ground",
handling: 1.5,
label: "Standard mockMethod",
name: "mockMethod",
rate: 1,
_id: "METHOD_ID",
enabled: true
}
]
};

const mockInvoice = Factory.OrderInvoice.makeOne({
currencyCode: "USD",
// Need to ensure 0 discount to avoid creating negative totals
Expand Down Expand Up @@ -58,14 +86,18 @@ beforeAll(async () => {
testApp.registerPlugin({
name: "addOrderFulfillmentGroup.test.js",
functionsByType: {
getFulfillmentMethodsWithQuotes: [getFulfillmentMethodsWithQuotes]
fulfillmentMethodsWithQuotes: [{ key: "shipping", handler: getFulfillmentMethodsWithQuotes }]
}
});

await testApp.start();

shopId = await insertPrimaryShop(testApp.context);

// Add shipping methods
mockFulfillmentEntry.shopId = shopId;
await testApp.collections.Fulfillment.insertOne(mockFulfillmentEntry);

const adminGroup = Factory.Group.makeOne({
_id: "adminGroup",
createdBy: null,
Expand Down Expand Up @@ -165,6 +197,7 @@ test("user with `reaction:legacy:orders/update` role can add an order fulfillmen
const group = Factory.OrderFulfillmentGroup.makeOne({
invoice: mockInvoice,
items: [orderItem],
type: "shipping",
shopId
});

Expand Down Expand Up @@ -303,6 +336,7 @@ test("user with `reaction:legacy:orders/move:item` role can add an order fulfill
currencyCode: "USD"
},
shopId,
type: "shipping",
totalItemQuantity: 12
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import encodeOpaqueId from "@reactioncommerce/api-utils/encodeOpaqueId.js";
import importAsString from "@reactioncommerce/api-utils/importAsString.js";
import getCommonData from "./checkoutTestsCommon.js";

Expand Down Expand Up @@ -269,7 +270,12 @@ describe("as an anonymous user", () => {
return;
}

const option = result.updateFulfillmentOptionsForGroup.cart.checkout.fulfillmentGroups[0].availableFulfillmentOptions[0];
const mockFulfillmentMethodId = "mockMethod";
const opaqueMockFulfillmentMethodId = encodeOpaqueId("reaction/fulfillmentMethod", mockFulfillmentMethodId);

// From the multiple Fulfillment methods, find out the exact method we are looking for
const options = result.updateFulfillmentOptionsForGroup.cart.checkout.fulfillmentGroups[0].availableFulfillmentOptions;
const option = options.find((opt) => opt.fulfillmentMethod._id === opaqueMockFulfillmentMethodId);
opaqueFulfillmentMethodId = option.fulfillmentMethod._id;

expect(option).toEqual({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ describe("as an anonymous user", () => {
productId: opaqueProductId,
productVariantId: opaqueCartProductVariantId
},
selectedFulfillmentType: "shipping",
quantity: 1
}
}
Expand Down Expand Up @@ -294,7 +295,12 @@ describe("as an anonymous user", () => {
return;
}

const option = result.updateFulfillmentOptionsForGroup.cart.checkout.fulfillmentGroups[0].availableFulfillmentOptions[0];
const mockFulfillmentMethodId = "mockMethod";
const opaqueMockFulfillmentMethodId = encodeOpaqueId("reaction/fulfillmentMethod", mockFulfillmentMethodId);

// From the multiple Fulfillment methods, find out the exact method we are looking for
const options = result.updateFulfillmentOptionsForGroup.cart.checkout.fulfillmentGroups[0].availableFulfillmentOptions;
const option = options.find((opt) => opt.fulfillmentMethod._id === opaqueMockFulfillmentMethodId);
opaqueFulfillmentMethodId = option.fulfillmentMethod._id;

expect(option).toEqual({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ describe("as a signed in user", () => {
productId: opaqueProductId,
productVariantId: opaqueCartProductVariantId
},
selectedFulfillmentType: "shipping",
quantity: 1
}
}
Expand Down Expand Up @@ -293,7 +294,12 @@ describe("as a signed in user", () => {
return;
}

const option = result.updateFulfillmentOptionsForGroup.cart.checkout.fulfillmentGroups[0].availableFulfillmentOptions[0];
const mockFulfillmentMethodId = "mockMethod";
const opaqueMockFulfillmentMethodId = encodeOpaqueId("reaction/fulfillmentMethod", mockFulfillmentMethodId);

// From the multiple Fulfillment methods, find out the exact method we are looking for
const options = result.updateFulfillmentOptionsForGroup.cart.checkout.fulfillmentGroups[0].availableFulfillmentOptions;
const option = options.find((opt) => opt.fulfillmentMethod._id === opaqueMockFulfillmentMethodId);
opaqueFulfillmentMethodId = option.fulfillmentMethod._id;

expect(option).toEqual({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,14 @@ const mockShippingMethod = {
label: "Flat Rate",
name: "flatRates"
},
fulfillmentType: "shipping",
methods: [
{
cost: 2.5,
fulfillmentTypes: [
"shipping"
],
fulfillmentMethod: "flatRate",
group: "Ground",
handling: 1.5,
label: "Standard mockMethod",
Expand Down Expand Up @@ -186,7 +188,7 @@ beforeAll(async () => {

// Add shipping methods
mockShippingMethod.shopId = internalShopId;
await testApp.collections.Shipping.insertOne(mockShippingMethod);
await testApp.collections.Fulfillment.insertOne(mockShippingMethod);

// Add Tags and products
mockProduct.shopId = internalShopId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const expectedProduct = {
{ service: "pinterest", message: "" },
{ service: "twitter", message: "" }
],
supportedFulfillmentTypes: ["shipping"],
supportedFulfillmentTypes: [],
tagIds: [],
title: "",
updatedAt: jasmine.any(String),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,37 @@ const mockShipmentMethod = {
handling: 0,
label: "mockLabel",
name: "mockName",
fulfillmentMethod: "flatRate",
rate: 3.99
};

const mockFulfillmentEntry = {
_id: "mockShippingMethod",
name: "Default Shipping Provider",
provider: {
enabled: true,
label: "Flat Rate",
name: "flatRates"
},
fulfillmentType: "shipping",
methods: [
{
cost: 2.5,
fulfillmentTypes: [
"shipping"
],
fulfillmentMethod: "flatRate",
group: "Ground",
handling: 1.5,
label: "Standard mockMethod",
name: "mockMethod",
rate: 1,
_id: "METHOD_ID",
enabled: true
}
]
};

beforeAll(async () => {
const getFulfillmentMethodsWithQuotes = (context, commonOrderExtended, [rates]) => {
rates.push({
Expand All @@ -46,13 +74,17 @@ beforeAll(async () => {
testApp.registerPlugin({
name: "moveOrderItems.test.js",
functionsByType: {
getFulfillmentMethodsWithQuotes: [getFulfillmentMethodsWithQuotes]
fulfillmentMethodsWithQuotes: [{ key: "shipping", handler: getFulfillmentMethodsWithQuotes }]
}
});

await testApp.start();
shopId = await insertPrimaryShop(testApp.context);

// Add shipping methods
mockFulfillmentEntry.shopId = shopId;
await testApp.collections.Fulfillment.insertOne(mockFulfillmentEntry);

catalogItem = Factory.Catalog.makeOne({
isDeleted: false,
product: Factory.CatalogProduct.makeOne({
Expand Down Expand Up @@ -124,6 +156,7 @@ test("user who placed an order can move an order item", async () => {
...mockShipmentMethod,
currencyCode: "USD"
},
type: "shipping",
shopId
});

Expand All @@ -138,6 +171,7 @@ test("user who placed an order can move an order item", async () => {
...mockShipmentMethod,
currencyCode: "USD"
},
type: "shipping",
shopId
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const adminGroup = Factory.Group.makeOne({
_id: "adminGroup",
createdBy: null,
name: "admin",
permissions: ["reaction:legacy:shippingMethods/create"],
permissions: ["reaction:legacy:fulfillmentMethods/create"],
slug: "admin",
shopId: internalShopId
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const adminGroup = Factory.Group.makeOne({
_id: "adminGroup",
createdBy: null,
name: "admin",
permissions: ["reaction:legacy:shippingRestrictions/create"],
permissions: ["reaction:legacy:fulfillmentRestrictions/create"],
slug: "admin",
shopId: internalShopId
});
Expand Down Expand Up @@ -81,7 +81,7 @@ test("shop owner cannot update flat rate fulfillment restriction if not logged i
}
});

test("user with `reaction:legacy:shippingMethods/create` permissions can update flat rate fulfillment restriction", async () => {
test("user with `reaction:legacy:fulfillmentMethods/create` permissions can update flat rate fulfillment restriction", async () => {
let result;
await testApp.setLoggedInUser(mockOwnerAccount);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const adminGroup = Factory.Group.makeOne({
_id: "adminGroup",
createdBy: null,
name: "admin",
permissions: ["reaction:legacy:shippingMethods/delete"],
permissions: ["reaction:legacy:fulfillmentMethods/delete"],
slug: "admin",
shopId: internalShopId
});
Expand Down Expand Up @@ -80,7 +80,7 @@ beforeAll(async () => {
await testApp.collections.Groups.insertOne(adminGroup);
await testApp.collections.Groups.insertOne(customerGroup);

await testApp.collections.Shipping.insertOne({
await testApp.collections.Fulfillment.insertOne({
methods: [{
_id: mockFulfillmentMethodId,
shopId: internalShopId,
Expand Down Expand Up @@ -114,7 +114,7 @@ test("user can not delete flat rate fulfillment method if admin is not logged in
}
});

test("user can delete flat rate fulfillment method if they have `reaction:legacy:shippingMethods/delete` permissions", async () => {
test("user can delete flat rate fulfillment method if they have `reaction:legacy:fulfillmentMethods/delete` permissions", async () => {
await testApp.setLoggedInUser(mockAdminAccount);

let result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const adminGroup = Factory.Group.makeOne({
_id: "adminGroup",
createdBy: null,
name: "admin",
permissions: ["reaction:legacy:shippingRestrictions/delete"],
permissions: ["reaction:legacy:fulfillmentRestrictions/delete"],
slug: "admin",
shopId: internalShopId
});
Expand All @@ -58,7 +58,7 @@ beforeAll(async () => {
await testApp.start();

await insertPrimaryShop(testApp.context, { _id: internalShopId, name: shopName });
await testApp.collections.FlatRateFulfillmentRestrictions.insertOne(mockFulfillmentRestriction);
await testApp.collections.FulfillmentRestrictions.insertOne(mockFulfillmentRestriction);
await testApp.collections.Groups.insertOne(adminGroup);

await testApp.createUserAndAccount(mockOwnerAccount);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const adminGroup = Factory.Group.makeOne({
_id: "adminGroup",
createdBy: null,
name: "admin",
permissions: ["reaction:legacy:shippingMethods/update"],
permissions: ["reaction:legacy:fulfillmentMethods/update"],
slug: "admin",
shopId: internalShopId
});
Expand Down Expand Up @@ -87,7 +87,7 @@ beforeAll(async () => {
await testApp.collections.Groups.insertOne(adminGroup);
await testApp.collections.Groups.insertOne(customerGroup);

await testApp.collections.Shipping.insertOne({
await testApp.collections.Fulfillment.insertOne({
methods: [mockFulfillmentMethod],
shopId: internalShopId
});
Expand Down
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载