sr-npm 1.7.366 → 1.7.368

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,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.366",
3
+ "version": "1.7.368",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -5,17 +5,31 @@ describe('Job details fetch from SR API Tests', () => {
5
5
 
6
6
  test('should successfully fetch job details from SR API', async () => {
7
7
  const requestBody = `fetchPositionsFromSRAPI();`;
8
- const wixDataResponse = await executeApiRequest(requestBody);
9
- const randomPosition = getRandomPosition(wixDataResponse.data.result.content);
8
+ const fetchJobsResponse = await executeApiRequest(requestBody);
9
+ const randomPosition = getRandomPosition(fetchJobsResponse.data.result.content);
10
10
  console.log("randomPosition: ", randomPosition);
11
- expect(wixDataResponse.data.result.totalFound).toBeGreaterThan(0);
12
- expect(wixDataResponse.data.result.content.length).toBeGreaterThan(0);
11
+ expect(fetchJobsResponse.data.result.totalFound).toBeGreaterThan(0);
12
+ expect(fetchJobsResponse.data.result.content.length).toBeGreaterThan(0);
13
13
  expect(randomPosition.id.length).toBeGreaterThan(0);
14
14
  expect(randomPosition.name.length).toBeGreaterThan(0);
15
15
  expect(randomPosition.jobAdId.length).toBeGreaterThan(0);
16
16
  expect(randomPosition.location).toBeDefined();
17
17
  expect(randomPosition.department).toBeDefined();
18
18
  });
19
+
20
+ test('should successfully fetch job description from SR API', async () => {
21
+ const fetchPositionsRequestBody = `fetchPositionsFromSRAPI();`;
22
+ const positions = await executeApiRequest(fetchPositionsRequestBody);
23
+ const randomPosition = getRandomPosition(positions.data.result.content);
24
+ const fetchJobDescriptionRequestBody = `fetchJobDescription(${randomPosition.id});`;
25
+ const jobFetchResponse = await executeApiRequest(fetchJobDescriptionRequestBody);
26
+ console.log("jobFetchResponse: ", jobFetchResponse.data.result);
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();
32
+ });
19
33
 
20
34
 
21
35