sr-npm 1.7.443 → 1.7.445
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.
|
@@ -103,8 +103,13 @@ async function fetchPositionsFromSRAPI(testObject=undefined) {
|
|
|
103
103
|
return result;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
async function fetchJobDescription(jobId) {
|
|
107
|
-
|
|
106
|
+
async function fetchJobDescription(jobId,testObject=undefined) {
|
|
107
|
+
let companyId, templateType;
|
|
108
|
+
if (testObject) {
|
|
109
|
+
({ companyId, templateType } = testObject);
|
|
110
|
+
} else {
|
|
111
|
+
({ companyId, templateType } = await getApiKeys());
|
|
112
|
+
}
|
|
108
113
|
return await makeSmartRecruitersRequest(`/v1/companies/${companyId}/postings/${jobId}`,templateType);
|
|
109
114
|
}
|
|
110
115
|
|
package/package.json
CHANGED
|
@@ -12,7 +12,6 @@ describe('Job details fetch from SR API Tests', () => {
|
|
|
12
12
|
describe(`Job details fetch from SR API Tests - ${templatename}`, () => {
|
|
13
13
|
let positions;
|
|
14
14
|
beforeAll(async () => {
|
|
15
|
-
|
|
16
15
|
const fetchPositionsFromSRAPIRequestBody = `fetchPositionsFromSRAPI({companyId:'WixTest',templateType: '${templateType}'});`;
|
|
17
16
|
positions = await executeApiRequest(fetchPositionsFromSRAPIRequestBody);
|
|
18
17
|
});
|
|
@@ -31,6 +30,7 @@ describe('Job details fetch from SR API Tests', () => {
|
|
|
31
30
|
|
|
32
31
|
test(`should successfully fetch job description from SR API (${templatename})`, async () => {
|
|
33
32
|
const randomPosition = getRandomPosition(positions.data.result.content);
|
|
33
|
+
console.log("randomPosition is : ", randomPosition);
|
|
34
34
|
const fetchJobDescriptionRequestBody = `fetchJobDescription(${randomPosition.id});`;
|
|
35
35
|
const jobFetchResponse = await executeApiRequest(fetchJobDescriptionRequestBody);
|
|
36
36
|
expect(jobFetchResponse.data.result.id).toBe(randomPosition.id);
|