Created
March 13, 2023 19:28
-
-
Save 3gcodes/e32b514a9469a0f286fba6a76d5df6fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('When valid Skill data is provided', () => { | |
test('Then do good things', async () => { | |
mockTransaction.mockResolvedValueOnce(true); | |
mockIsAuthenticated.mockResolvedValueOnce(true); | |
mockCareerPathGroupFindByPk.mockResolvedValueOnce({ | |
id: 1, | |
}); | |
mockEmployeeExistsByPk.mockResolvedValueOnce(true); | |
mockJobTypeExistsByPk | |
.mockResolvedValueOnce(true) | |
.mockReturnValueOnce(true); | |
mockSkillsBadgesFindOne | |
.mockResolvedValueOnce({ id: 1 }) | |
.mockResolvedValueOnce({ id: 2 }) | |
.mockResolvedValueOnce({ id: 3 }); | |
mockSkillsBadgesToEmployeesFindOne | |
.mockResolvedValueOnce({ | |
id: 1, | |
}) | |
.mockResolvedValueOnce({ | |
id: 2, | |
}) | |
.mockResolvedValueOnce({ | |
id: 3, | |
}); | |
mockSkillsToJobTypesFindOne | |
.mockResolvedValueOnce({ | |
id: 1, | |
}) | |
.mockResolvedValueOnce({ | |
id: 2, | |
}) | |
.mockResolvedValueOnce({ | |
id: 3, | |
}); | |
mockAbilitiesBadgesFindOne | |
.mockResolvedValueOnce({ | |
id: 1, | |
}) | |
.mockResolvedValueOnce({ | |
id: 2, | |
}) | |
.mockResolvedValueOnce({ | |
id: 3, | |
}); | |
mockAbilitiesBadgesToEmployeesFindOne | |
.mockResolvedValueOnce({ id: 1 }) | |
.mockResolvedValueOnce({ id: 2 }) | |
.mockResolvedValueOnce({ id: 3 }); | |
mockAbilitiesToJobTypesFindOne | |
.mockResolvedValueOnce({ | |
id: 1, | |
}) | |
.mockResolvedValueOnce({ | |
id: 2, | |
}) | |
.mockResolvedValueOnce({ | |
id: 3, | |
}); | |
mockSkillsToBadgesBulkCreate.mockResolvedValueOnce([ | |
{ | |
id: 1, | |
}, | |
{ | |
id: 2, | |
}, | |
{ | |
id: 3, | |
}, | |
]); | |
mockAbilitiesToBadgesBulCreate.mockResolvedValueOnce([ | |
{ | |
id: 1, | |
}, | |
{ | |
id: 2, | |
}, | |
{ | |
id: 3, | |
}, | |
]); | |
mockSkillsToJobTypesBulkCreate.mockResolvedValueOnce([ | |
{ | |
id: 1, | |
}, | |
{ | |
id: 2, | |
}, | |
{ | |
id: 3, | |
}, | |
]); | |
mockAbilitiesToJobTypesBulkCreate.mockResolvedValueOnce([ | |
{ | |
id: 1, | |
}, | |
{ | |
id: 2, | |
}, | |
{ | |
id: 3, | |
}, | |
]); | |
const response = await addSkillsToCareerPath( | |
{}, | |
{ | |
careerPathGroupId: 1, | |
employeeId: 1, | |
hardSkills: { jobTypeId: 1, skillIds: [1, 2, 3] }, | |
softSkills: { jobTypeId: 1, abilityIds: [1, 2, 3] }, | |
}, | |
{}, | |
); | |
expect(response).toBeDefined(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment