From c2e2387ec5d251322314829706d827a1b88f9940 Mon Sep 17 00:00:00 2001 From: Chris Pyle Date: Fri, 24 Jan 2025 19:10:14 -0500 Subject: [PATCH] #3124 fixed tests --- src/backend/tests/unit/recruitment.test.ts | 22 ++++++++++++++----- .../tests/unmocked/recruitment.test.ts | 22 ++++++++++++++----- 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/src/backend/tests/unit/recruitment.test.ts b/src/backend/tests/unit/recruitment.test.ts index dddb6a6ba6..3efaab8cc5 100644 --- a/src/backend/tests/unit/recruitment.test.ts +++ b/src/backend/tests/unit/recruitment.test.ts @@ -39,19 +39,19 @@ describe('Recruitment Tests', () => { describe('Get All FAQs', () => { it('Succeeds and gets all the FAQs', async () => { - const faq1 = await RecruitmentServices.createFaq( + const faq1 = await RecruitmentServices.createOrganizationFaq( await createTestUser(batmanAppAdmin, orgId), 'question', 'answer', organization ); - const faq2 = await RecruitmentServices.createFaq( + const faq2 = await RecruitmentServices.createOrganizationFaq( await createTestUser(supermanAdmin, orgId), 'question2', 'answer2', organization ); - const result = await RecruitmentServices.getAllFaqs(organization); + const result = await RecruitmentServices.getAllOrganizationFaqs(organization); expect(result).toStrictEqual([faq1, faq2]); }); @@ -233,7 +233,12 @@ describe('Recruitment Tests', () => { it('Fails if user is not an admin', async () => { await expect( async () => - await RecruitmentServices.createFaq(await createTestUser(member, orgId), 'question', 'answer', organization) + await RecruitmentServices.createOrganizationFaq( + await createTestUser(member, orgId), + 'question', + 'answer', + organization + ) ).rejects.toThrow(new AccessDeniedAdminOnlyException('create an faq')); }); @@ -279,12 +284,17 @@ describe('Recruitment Tests', () => { it('Fails if user is not an admin', async () => { await expect( async () => - await RecruitmentServices.createFaq(await createTestUser(member, orgId), 'question', 'answer', organization) + await RecruitmentServices.createOrganizationFaq( + await createTestUser(member, orgId), + 'question', + 'answer', + organization + ) ).rejects.toThrow(new AccessDeniedAdminOnlyException('create an faq')); }); it('Succeeds and creates an FAQ', async () => { - const result = await RecruitmentServices.createFaq( + const result = await RecruitmentServices.createOrganizationFaq( await createTestUser(batmanAppAdmin, orgId), 'question', 'answer', diff --git a/src/backend/tests/unmocked/recruitment.test.ts b/src/backend/tests/unmocked/recruitment.test.ts index dddb6a6ba6..3efaab8cc5 100644 --- a/src/backend/tests/unmocked/recruitment.test.ts +++ b/src/backend/tests/unmocked/recruitment.test.ts @@ -39,19 +39,19 @@ describe('Recruitment Tests', () => { describe('Get All FAQs', () => { it('Succeeds and gets all the FAQs', async () => { - const faq1 = await RecruitmentServices.createFaq( + const faq1 = await RecruitmentServices.createOrganizationFaq( await createTestUser(batmanAppAdmin, orgId), 'question', 'answer', organization ); - const faq2 = await RecruitmentServices.createFaq( + const faq2 = await RecruitmentServices.createOrganizationFaq( await createTestUser(supermanAdmin, orgId), 'question2', 'answer2', organization ); - const result = await RecruitmentServices.getAllFaqs(organization); + const result = await RecruitmentServices.getAllOrganizationFaqs(organization); expect(result).toStrictEqual([faq1, faq2]); }); @@ -233,7 +233,12 @@ describe('Recruitment Tests', () => { it('Fails if user is not an admin', async () => { await expect( async () => - await RecruitmentServices.createFaq(await createTestUser(member, orgId), 'question', 'answer', organization) + await RecruitmentServices.createOrganizationFaq( + await createTestUser(member, orgId), + 'question', + 'answer', + organization + ) ).rejects.toThrow(new AccessDeniedAdminOnlyException('create an faq')); }); @@ -279,12 +284,17 @@ describe('Recruitment Tests', () => { it('Fails if user is not an admin', async () => { await expect( async () => - await RecruitmentServices.createFaq(await createTestUser(member, orgId), 'question', 'answer', organization) + await RecruitmentServices.createOrganizationFaq( + await createTestUser(member, orgId), + 'question', + 'answer', + organization + ) ).rejects.toThrow(new AccessDeniedAdminOnlyException('create an faq')); }); it('Succeeds and creates an FAQ', async () => { - const result = await RecruitmentServices.createFaq( + const result = await RecruitmentServices.createOrganizationFaq( await createTestUser(batmanAppAdmin, orgId), 'question', 'answer',