Browse Source

test(core): Fix failing e2e test for mysql

Michael Bromley 3 years ago
parent
commit
e786c4d339
1 changed files with 6 additions and 3 deletions
  1. 6 3
      packages/core/e2e/fixtures/test-plugins/list-query-plugin.ts

+ 6 - 3
packages/core/e2e/fixtures/test-plugins/list-query-plugin.ts

@@ -104,7 +104,8 @@ export class TestEntityPrice extends VendureEntity {
         super(input);
     }
 
-    @EntityId() channelId: ID;
+    @Column()
+    channelId: number;
 
     @Column()
     price: number;
@@ -125,7 +126,8 @@ export class ListQueryResolver {
             .then(([items, totalItems]) => {
                 for (const item of items) {
                     if (item.prices && item.prices.length) {
-                        item.activePrice = item.prices[0].price;
+                        // tslint:disable-next-line:no-non-null-assertion
+                        item.activePrice = item.prices.find(p => p.channelId === 1)!.price;
                     }
                 }
                 return {
@@ -143,7 +145,8 @@ export class ListQueryResolver {
             .then(items => {
                 for (const item of items) {
                     if (item.prices && item.prices.length) {
-                        item.activePrice = item.prices[0].price;
+                        // tslint:disable-next-line:no-non-null-assertion
+                        item.activePrice = item.prices.find(p => p.channelId === 1)!.price;
                     }
                 }
                 return items.map(i => translateDeep(i, ctx.languageCode));