sr-npm 1.7.431 → 1.7.433

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/backend/data.js CHANGED
@@ -346,21 +346,18 @@ async function clearCollections() {
346
346
 
347
347
  async function markTemplateAsExternal() {
348
348
  await createCollectionIfMissing(COLLECTIONS.TEMPLATE_TYPE, COLLECTIONS_FIELDS.TEMPLATE_TYPE,null,'singleItem');
349
- console.log("marking template as external");
350
- console.log("TEMPLATE_TYPE: ", TEMPLATE_TYPE);
351
- await wixData.save(COLLECTIONS.TEMPLATE_TYPE, {
349
+ const tempalte = await wixData.save(COLLECTIONS.TEMPLATE_TYPE, {
352
350
  templateType: TEMPLATE_TYPE.EXTERNAL
353
351
  });
352
+ return tempalte;
354
353
  }
355
354
 
356
355
  async function markTemplateAsInternal() {
357
356
  await createCollectionIfMissing(COLLECTIONS.TEMPLATE_TYPE, COLLECTIONS_FIELDS.TEMPLATE_TYPE,null,'singleItem');
358
- console.log("marking template as internal");
359
- console.log("COLLECTIONS: ", COLLECTIONS);
360
- console.log("TEMPLATE_TYPE: ", TEMPLATE_TYPE);
361
- await wixData.save(COLLECTIONS.TEMPLATE_TYPE, {
357
+ const tempalte = await wixData.save(COLLECTIONS.TEMPLATE_TYPE, {
362
358
  templateType: TEMPLATE_TYPE.INTERNAL
363
359
  });
360
+ return tempalte;
364
361
  }
365
362
 
366
363
  async function fillSecretManagerMirror() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.431",
3
+ "version": "1.7.433",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -12,11 +12,10 @@ it.each([
12
12
  { templateName: 'Internal', templateType: TEMPLATE_TYPE.INTERNAL },
13
13
  { templateName: 'External', templateType: TEMPLATE_TYPE.EXTERNAL },
14
14
  ])('should successfully mark template as $templateName', async ({ templateName,templateType }) => {
15
- // damn, let's build the request body dynamically
16
15
  const requestBody = `markTemplateAs${templateName}();`;
17
- await executeApiRequest(requestBody);
18
- const TemplateTypeFromCMS = await wixData.query(COLLECTIONS.TEMPLATE_TYPE).limit(1).find();
19
- expect(TemplateTypeFromCMS.items[0].templateType).toBe(templateType);
16
+ const response = await executeApiRequest(requestBody);
17
+ console.log("response: ", response);
18
+ expect(response.status).toBe(200);
20
19
  });
21
20
 
22
21