sr-npm 1.7.439 → 1.7.441

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
@@ -362,7 +362,6 @@ async function fillSecretManagerMirror() {
362
362
  console.log("Getting the company ID ");
363
363
  const companyId = await getCompanyId();
364
364
  console.log("companyId is : ", companyId);
365
- console.log("TOKEN_NAME is , ", TOKEN_NAME);
366
365
  await wixData.insert(COLLECTIONS.SECRET_MANAGER_MIRROR, {
367
366
  tokenName: TOKEN_NAME.COMPANY_ID,
368
367
  tokenValue: companyId.value
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.439",
3
+ "version": "1.7.441",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,35 +1,41 @@
1
1
  const { executeApiRequest } = require('tests-utils');
2
2
  const { getRandomPosition, executeRequestAndTest } = require('./testsUtils');
3
3
 
4
- describe('Job details fetch from SR API Tests', () => {
4
+ describe('Job details fetch from SR API Tests', async () => {
5
5
 
6
- let positions;
7
- beforeAll(async () => {
8
- const requestBody = `fetchPositionsFromSRAPI();`;
9
- positions = await executeApiRequest(requestBody);
10
- });
11
-
12
- test('should successfully fetch job details from SR API', async () => {
13
- const randomPosition = getRandomPosition(positions.data.result.content);
14
- expect(positions.data.result.totalFound).toBeGreaterThan(0);
15
- expect(positions.data.result.content.length).toBeGreaterThan(0);
16
- expect(randomPosition.id.length).toBeGreaterThan(0);
17
- expect(randomPosition.name.length).toBeGreaterThan(0);
18
- expect(randomPosition.jobAdId.length).toBeGreaterThan(0);
19
- expect(randomPosition.location).toBeDefined();
20
- expect(randomPosition.department).toBeDefined();
21
- });
6
+ const templateTypes = [
7
+ { templatename: 'External', templateType: 'PUBLIC'},
8
+ { templatename: 'Internal', templateType: 'INTERNAL'}
9
+ ];
10
+
11
+ templateTypes.forEach(({ templateType ,templatename}) => {
12
+ describe(`Job details fetch from SR API Tests - ${templatename}`, async () => {
13
+ const fetchPositionsFromSRAPIRequestBody = `fetchPositionsFromSRAPI({companyId:'WixTest',templateType: '${templateType}'});`;
14
+ const positions = await executeApiRequest(fetchPositionsFromSRAPIRequestBody);
22
15
 
23
- test('should successfully fetch job description from SR API', async () => {
24
- const randomPosition = getRandomPosition(positions.data.result.content);
25
- const fetchJobDescriptionRequestBody = `fetchJobDescription(${randomPosition.id});`;
26
- const jobFetchResponse = await executeApiRequest(fetchJobDescriptionRequestBody);
27
- expect(jobFetchResponse.data.result.id).toBe(randomPosition.id);
28
- expect(jobFetchResponse.data.result.jobAd.sections.jobDescription).toBeDefined();
29
- expect(jobFetchResponse.data.result.jobAd.sections.jobDescription.text.length).toBeGreaterThan(0);
30
- expect(jobFetchResponse.data.result.applyUrl.length).toBeGreaterThan(0);
31
- expect(jobFetchResponse.data.result.location).toBeDefined();
16
+ test(`should successfully fetch job details from SR API (${templatename})`, async () => {
17
+ const randomPosition = getRandomPosition(positions.data.result.content);
18
+ expect(positions.data.result.totalFound).toBeGreaterThan(0);
19
+ expect(positions.data.result.content.length).toBeGreaterThan(0);
20
+ expect(randomPosition.id.length).toBeGreaterThan(0);
21
+ expect(randomPosition.name.length).toBeGreaterThan(0);
22
+ expect(randomPosition.jobAdId.length).toBeGreaterThan(0);
23
+ expect(randomPosition.location).toBeDefined();
24
+ expect(randomPosition.department).toBeDefined();
25
+ });
26
+
27
+ test(`should successfully fetch job description from SR API (${templatename})`, async () => {
28
+ const randomPosition = getRandomPosition(positions.data.result.content);
29
+ const fetchJobDescriptionRequestBody = `fetchJobDescription(${randomPosition.id});`;
30
+ const jobFetchResponse = await executeApiRequest(fetchJobDescriptionRequestBody);
31
+ expect(jobFetchResponse.data.result.id).toBe(randomPosition.id);
32
+ expect(jobFetchResponse.data.result.jobAd.sections.jobDescription).toBeDefined();
33
+ expect(jobFetchResponse.data.result.jobAd.sections.jobDescription.text.length).toBeGreaterThan(0);
34
+ expect(jobFetchResponse.data.result.applyUrl.length).toBeGreaterThan(0);
35
+ expect(jobFetchResponse.data.result.location).toBeDefined();
36
+ });
32
37
  });
38
+ });
33
39
  });
34
40
 
35
41
  describe('fetchPositionsFromSRAPI error handling', () => {