@quintype/framework 7.10.0 → 7.10.1-custom-infinite-scroll.2

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/CHANGELOG.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- ## [7.10.0](https://github.com/quintype/quintype-node-framework/compare/v7.7.7...v7.10.0) (2022-10-03)
5
+ ## [7.10.0](https://github.com/quintype/quintype-node-framework/compare/v7.7.7...v7.10.0) (2022-10-04)
6
6
 
7
7
 
8
8
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/framework",
3
- "version": "7.10.0",
3
+ "version": "7.10.1-custom-infinite-scroll.2",
4
4
  "description": "Libraries to help build Quintype Node.js apps",
5
5
  "main": "index.js",
6
6
  "engines": {
@@ -81,7 +81,7 @@ class InfiniteScrollAmp {
81
81
  return JSON.stringify(formattedData);
82
82
  }
83
83
 
84
- async getInitialInlineConfig(storyId) {
84
+ async getInitialInlineConfig({ storyId }) {
85
85
  if (!storyId) return new Error("Required params for getInitialInlineConfig missing");
86
86
  const filteredItems =
87
87
  await this.getInfiniteScrollList({ storyId, type: "inlineConfig", offset: 0, limit: 5 });
@@ -122,7 +122,7 @@ function getClientStub({
122
122
  } = {}) {
123
123
  return {
124
124
  getCollectionBySlug,
125
- getStoryById
125
+ getStoryById,
126
126
  };
127
127
  }
128
128
  const dummyPublisherConfig = {
@@ -136,7 +136,7 @@ describe("getInitialInlineConfig method of InfiniteScrollAmp helper function", f
136
136
  client: getClientStub(),
137
137
  publisherConfig: dummyPublisherConfig,
138
138
  });
139
- const inlineConfig = await infiniteScrollAmp.getInitialInlineConfig();
139
+ const inlineConfig = await infiniteScrollAmp.getInitialInlineConfig({ storyId: "" });
140
140
  assert.strictEqual(inlineConfig instanceof Error, true);
141
141
  assert.throws(() => {
142
142
  throw new Error("Required params for getInitialInlineConfig missing");
@@ -155,7 +155,7 @@ describe("getInitialInlineConfig method of InfiniteScrollAmp helper function", f
155
155
  publisherConfig: dummyPublisherConfig,
156
156
  });
157
157
  const inlineConfig = await infiniteScrollAmp.getInitialInlineConfig({
158
- storyId: 1111,
158
+ storyId: 2222,
159
159
  });
160
160
  assert.strictEqual(inlineConfig, null);
161
161
  });
@@ -174,7 +174,7 @@ describe("getInitialInlineConfig method of InfiniteScrollAmp helper function", f
174
174
  publisherConfig: dummyPublisherConfig,
175
175
  });
176
176
  const inlineConfig = await infiniteScrollAmp.getInitialInlineConfig({
177
- storyId: 1111,
177
+ storyId: 2222,
178
178
  });
179
179
  assert.strictEqual(inlineConfig, null);
180
180
  });
@@ -186,7 +186,7 @@ describe("getInitialInlineConfig method of InfiniteScrollAmp helper function", f
186
186
  publisherConfig: dummyPublisherConfig,
187
187
  });
188
188
  const inlineConfig = await infiniteScrollAmp.getInitialInlineConfig({
189
- storyId: 1111,
189
+ storyId: 2222,
190
190
  });
191
191
  assert.strictEqual(false, /sports\/bb/.test(inlineConfig));
192
192
  assert.strictEqual(false, /bb\/b.jpg/.test(inlineConfig));
@@ -199,7 +199,7 @@ describe("getInitialInlineConfig method of InfiniteScrollAmp helper function", f
199
199
  publisherConfig: dummyPublisherConfig,
200
200
  });
201
201
  const inlineConfig = await infiniteScrollAmp.getInitialInlineConfig({
202
- storyId: 1111,
202
+ storyId: 3333,
203
203
  });
204
204
  assert.strictEqual(false, /sports\/bb/.test(inlineConfig));
205
205
  assert.strictEqual(false, /bb\/b.jpg/.test(inlineConfig));
@@ -213,7 +213,7 @@ describe("getInitialInlineConfig method of InfiniteScrollAmp helper function", f
213
213
  publisherConfig: dummyPublisherConfig,
214
214
  });
215
215
  const inlineConfig = await infiniteScrollAmp.getInitialInlineConfig({
216
- storyId: 1111,
216
+ storyId: 2222,
217
217
  });
218
218
  function isInlineConfigStructureValid(jsonStr) {
219
219
  const stories = JSON.parse(jsonStr);