@reactionary/examples-node 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@reactionary/examples-node",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "main": "index.js",
5
5
  "types": "src/index.d.ts",
6
6
  "dependencies": {
7
- "@reactionary/core": "0.3.6",
8
- "@reactionary/provider-commercetools": "0.3.6",
9
- "@reactionary/provider-algolia": "0.3.6",
10
- "@reactionary/provider-medusa": "0.3.6",
11
- "@reactionary/provider-meilisearch": "0.3.6"
7
+ "@reactionary/core": "0.3.7",
8
+ "@reactionary/provider-commercetools": "0.3.7",
9
+ "@reactionary/provider-algolia": "0.3.7",
10
+ "@reactionary/provider-medusa": "0.3.7",
11
+ "@reactionary/provider-meilisearch": "0.3.7"
12
12
  },
13
13
  "type": "module"
14
14
  }
@@ -36,6 +36,17 @@ describe.each([PrimaryProvider.MEDUSA])(
36
36
  }
37
37
 
38
38
  expect(result.value.length).toBeGreaterThan(0);
39
+
40
+ expect(result.value[0].recommendationReturnType).toBe('productSearchResultItem');
41
+ if (result.value[0].recommendationReturnType === 'productSearchResultItem') {
42
+ expect(result.value[0].product.identifier.key).toBeDefined();
43
+ expect(result.value[0].product.name).toBeDefined();
44
+ expect(result.value[0].product.slug).toBeDefined();
45
+ expect(result.value[0].product.variants).toBeDefined();
46
+ expect(result.value[0].product.variants.length).toBeGreaterThan(0);
47
+ expect(result.value[0].product.variants[0].variant.sku).toBeDefined();
48
+ expect(result.value[0].product.variants[0].image.sourceUrl).toBeDefined();
49
+ }
39
50
  });
40
51
 
41
52
  it('should return an empty result for an unknown collection', async () => {
@@ -76,7 +87,16 @@ describe.each([PrimaryProvider.MEILISEARCH])(
76
87
  }
77
88
 
78
89
  expect(result.value.length).toBeGreaterThan(0);
79
- expect(result.value[0].product.key).toBeDefined();
90
+ expect(result.value[0].recommendationReturnType).toBe('productSearchResultItem');
91
+ if (result.value[0].recommendationReturnType === 'productSearchResultItem') {
92
+ expect(result.value[0].product.identifier.key).toBeDefined();
93
+ expect(result.value[0].product.name).toBeDefined();
94
+ expect(result.value[0].product.slug).toBeDefined();
95
+ expect(result.value[0].product.variants).toBeDefined();
96
+ expect(result.value[0].product.variants.length).toBeGreaterThan(0);
97
+ expect(result.value[0].product.variants[0].variant.sku).toBeDefined();
98
+ expect(result.value[0].product.variants[0].image.sourceUrl).toBeDefined();
99
+ }
80
100
  expect(result.value[0].recommendationIdentifier.key).toBeDefined();
81
101
  });
82
102
 
@@ -122,6 +142,17 @@ describe.each([PrimaryProvider.ALGOLIA])(
122
142
  }
123
143
 
124
144
  expect(result.value.length).toBeGreaterThan(0);
145
+ expect(result.value[0].recommendationReturnType).toBe('productSearchResultItem');
146
+ if (result.value[0].recommendationReturnType === 'productSearchResultItem') {
147
+ expect(result.value[0].product.identifier.key).toBeDefined();
148
+ expect(result.value[0].product.name).toBeDefined();
149
+ expect(result.value[0].product.slug).toBeDefined();
150
+ expect(result.value[0].product.variants).toBeDefined();
151
+ expect(result.value[0].product.variants.length).toBeGreaterThan(0);
152
+ expect(result.value[0].product.variants[0].variant.sku).toBeDefined();
153
+ expect(result.value[0].product.variants[0].image.sourceUrl).toBeDefined();
154
+ }
155
+
125
156
  });
126
157
 
127
158
  it('should return an empty result for an unknown sku', async () => {