Skip to content

Commit

Permalink
test(core): Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Jul 4, 2023
1 parent 2303328 commit 62d1c3b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
2 changes: 2 additions & 0 deletions packages/core/e2e/channel.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ describe('Channels', () => {
id: 'T_2',
code: 'second-channel',
token: SECOND_CHANNEL_TOKEN,
availableCurrencyCodes: ['GBP'],
currencyCode: 'GBP',
defaultCurrencyCode: 'GBP',
defaultLanguageCode: 'en',
defaultShippingZone: {
id: 'T_1',
Expand Down
24 changes: 18 additions & 6 deletions packages/core/e2e/product.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,9 @@ describe('Product resolver', () => {
},
});

expect(productVariants.items).toEqual([
expect(
productVariants.items.map(i => pick(i, ['id', 'name', 'price', 'priceWithTax', 'sku'])),
).toEqual([
{
id: 'T_34',
name: 'Bonsai Tree',
Expand Down Expand Up @@ -702,7 +704,9 @@ describe('Product resolver', () => {
},
});

expect(productVariants.items).toEqual([
expect(
productVariants.items.map(i => pick(i, ['id', 'name', 'price', 'priceWithTax', 'sku'])),
).toEqual([
{
id: 'T_23',
name: 'Skipping Rope',
Expand Down Expand Up @@ -740,7 +744,9 @@ describe('Product resolver', () => {
},
});

expect(productVariants.items).toEqual([
expect(
productVariants.items.map(i => pick(i, ['id', 'name', 'price', 'priceWithTax', 'sku'])),
).toEqual([
{
id: 'T_23',
name: 'Skipping Rope',
Expand Down Expand Up @@ -783,7 +789,9 @@ describe('Product resolver', () => {
},
});

expect(productVariants.items).toEqual([
expect(
productVariants.items.map(i => pick(i, ['id', 'name', 'price', 'priceWithTax', 'sku'])),
).toEqual([
{
id: 'T_20',
name: 'Tripod',
Expand Down Expand Up @@ -814,7 +822,9 @@ describe('Product resolver', () => {

// Note the results are incorrect. This is a design trade-off. See the
// commend on the ProductVariant.priceWithTax annotation for explanation.
expect(productVariants.items).toEqual([
expect(
productVariants.items.map(i => pick(i, ['id', 'name', 'price', 'priceWithTax', 'sku'])),
).toEqual([
{
id: 'T_20',
name: 'Tripod',
Expand All @@ -839,7 +849,9 @@ describe('Product resolver', () => {
productId: 'T_1',
});

expect(productVariants.items).toEqual([
expect(
productVariants.items.map(i => pick(i, ['id', 'name', 'price', 'priceWithTax', 'sku'])),
).toEqual([
{
id: 'T_1',
name: 'Laptop 13 inch 8GB',
Expand Down

0 comments on commit 62d1c3b

Please sign in to comment.