sr-npm 1.7.374 → 1.7.375
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
|
@@ -2,13 +2,17 @@ const { executeApiRequest } = require('tests-utils');
|
|
|
2
2
|
const { getRandomPosition } = require('./testsUtils');
|
|
3
3
|
|
|
4
4
|
describe('Job details fetch from SR API Tests', () => {
|
|
5
|
+
|
|
6
|
+
let positions;
|
|
7
|
+
beforeAll(async () => {
|
|
8
|
+
const requestBody = `fetchPositionsFromSRAPI();`;
|
|
9
|
+
positions = await executeApiRequest(requestBody);
|
|
10
|
+
});
|
|
5
11
|
|
|
6
12
|
test('should successfully fetch job details from SR API', async () => {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
expect(fetchJobsResponse.data.result.totalFound).toBeGreaterThan(0);
|
|
11
|
-
expect(fetchJobsResponse.data.result.content.length).toBeGreaterThan(0);
|
|
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);
|
|
12
16
|
expect(randomPosition.id.length).toBeGreaterThan(0);
|
|
13
17
|
expect(randomPosition.name.length).toBeGreaterThan(0);
|
|
14
18
|
expect(randomPosition.jobAdId.length).toBeGreaterThan(0);
|
|
@@ -17,8 +21,6 @@ describe('Job details fetch from SR API Tests', () => {
|
|
|
17
21
|
});
|
|
18
22
|
|
|
19
23
|
test('should successfully fetch job description from SR API', async () => {
|
|
20
|
-
const fetchPositionsRequestBody = `fetchPositionsFromSRAPI();`;
|
|
21
|
-
const positions = await executeApiRequest(fetchPositionsRequestBody);
|
|
22
24
|
const randomPosition = getRandomPosition(positions.data.result.content);
|
|
23
25
|
const fetchJobDescriptionRequestBody = `fetchJobDescription(${randomPosition.id});`;
|
|
24
26
|
const jobFetchResponse = await executeApiRequest(fetchJobDescriptionRequestBody);
|