sr-npm 1.7.439 → 1.7.440
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,35 +1,49 @@
|
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
const templateTypes = [
|
|
7
|
+
{ templateType: 'External'},
|
|
8
|
+
{ templateType: 'Internal'}
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
templateTypes.forEach(({ templateType }) => {
|
|
12
|
+
describe(`Job details fetch from SR API Tests - ${templateType}`, async () => {
|
|
13
|
+
const markTemplateAsRequestBody = `markTemplateAs${templateType}();`;
|
|
14
|
+
try{
|
|
15
|
+
await executeApiRequest(markTemplateAsRequestBody);
|
|
16
|
+
}
|
|
17
|
+
catch(error){
|
|
18
|
+
console.error(`Error marking template as ${templateType}:`, error);
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
const fetchPositionsFromSRAPIRequestBody = `fetchPositionsFromSRAPI();`;
|
|
22
|
+
const positions = await executeApiRequest(fetchPositionsFromSRAPIRequestBody);
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
test(`should successfully fetch job details from SR API (${templateType})`, async () => {
|
|
25
|
+
const randomPosition = getRandomPosition(positions.data.result.content);
|
|
26
|
+
expect(positions.data.result.totalFound).toBeGreaterThan(0);
|
|
27
|
+
expect(positions.data.result.content.length).toBeGreaterThan(0);
|
|
28
|
+
expect(randomPosition.id.length).toBeGreaterThan(0);
|
|
29
|
+
expect(randomPosition.name.length).toBeGreaterThan(0);
|
|
30
|
+
expect(randomPosition.jobAdId.length).toBeGreaterThan(0);
|
|
31
|
+
expect(randomPosition.location).toBeDefined();
|
|
32
|
+
expect(randomPosition.department).toBeDefined();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test(`should successfully fetch job description from SR API (${templateType})`, async () => {
|
|
36
|
+
const randomPosition = getRandomPosition(positions.data.result.content);
|
|
37
|
+
const fetchJobDescriptionRequestBody = `fetchJobDescription(${randomPosition.id});`;
|
|
38
|
+
const jobFetchResponse = await executeApiRequest(fetchJobDescriptionRequestBody);
|
|
39
|
+
expect(jobFetchResponse.data.result.id).toBe(randomPosition.id);
|
|
40
|
+
expect(jobFetchResponse.data.result.jobAd.sections.jobDescription).toBeDefined();
|
|
41
|
+
expect(jobFetchResponse.data.result.jobAd.sections.jobDescription.text.length).toBeGreaterThan(0);
|
|
42
|
+
expect(jobFetchResponse.data.result.applyUrl.length).toBeGreaterThan(0);
|
|
43
|
+
expect(jobFetchResponse.data.result.location).toBeDefined();
|
|
44
|
+
});
|
|
32
45
|
});
|
|
46
|
+
});
|
|
33
47
|
});
|
|
34
48
|
|
|
35
49
|
describe('fetchPositionsFromSRAPI error handling', () => {
|