import {describe, it} from 'node:test'; import assert from 'node:assert/strict'; import {mapIcmsToMcfScheme, mapMcfToIcmsScheme, mapMcfToMsfScheme, mapMsfToMcfScheme} from './schemes'; import {SCHEME_ID} from '../mcf'; describe('mapIcmsToMcfScheme', () => { it('should map to Career Support Programme when id is 541001', () => { assert.deepStrictEqual(mapIcmsToMcfScheme(541001), { id: SCHEME_ID.CAREER_SUPPORT, scheme: 'Career Support Programme', startDate: '1977-05-25', expiryDate: '2055-05-04', link: 'http://www.swda.gov.sg/programmes-and-initiatives/wsg-career-support-programme-employers.html', jobseekerLink: 'http://www.wsg.gov.sg/programmes-and-initiatives/wsg-career-support-programme-individuals.html', }); }); it('should map to Career Conversion Programme when id is 541002', () => { assert.deepStrictEqual(mapIcmsToMcfScheme(541002), { id: SCHEME_ID.CCP, scheme: 'Career Conversion Programme', startDate: '1977-05-25', expiryDate: '2055-05-04', link: 'https://www.swda.gov.sg/home/employers-industry-partners/workforce-skills-development/career-conversion-programmes-employers', jobseekerLink: 'https://conversion.mycareersfuture.gov.sg/Portal/ProgramListing.aspx?Source=PCP', }); }); it('should map to P-Max when id is 541003', () => { assert.deepStrictEqual(mapIcmsToMcfScheme(541003), { id: SCHEME_ID.P_MAX, scheme: 'P-Max', startDate: '1977-05-25', expiryDate: '2055-05-04', link: 'http://www.swda.gov.sg/programmes-and-initiatives/p-max-employer.html', jobseekerLink: 'http://www.wsg.gov.sg/programmes-and-initiatives/p-max-employer.html', }); }); it('should map to Career Trial when id is 541005', () => { assert.deepStrictEqual(mapIcmsToMcfScheme(541005), { id: SCHEME_ID.CAREER_TRIAL, scheme: 'Career Trial', startDate: '1977-05-25', expiryDate: '2055-05-04', link: 'http://www.swda.gov.sg/programmes-and-initiatives/career-trial-employers.html', jobseekerLink: 'https://programmes.mycareersfuture.gov.sg/CareerTrialJobseekers/ProgrammeDetails.aspx', }); }); it('should map to SGUnited Traineeships when id is 541006', () => { assert.deepStrictEqual(mapIcmsToMcfScheme(541006), { id: SCHEME_ID.SG_UNITED_TRAINEESHIPS, scheme: 'SGUnited Traineeships', startDate: '2020-06-01', expiryDate: '2047-06-01', link: 'https://www.swda.gov.sg/SGUnitedTraineeships-HostCompanies.html', jobseekerLink: 'https://www.wsg.gov.sg/SGUnitedTraineeships-Trainees.html', }); }); it('should map to SGUnited Mid-Career Pathways Programme when id is 541007', () => { assert.deepStrictEqual(mapIcmsToMcfScheme(541007), { id: SCHEME_ID.SG_UNITED_MID_CAREER_PATHWAYS, scheme: 'SGUnited Mid-Career Pathways Programme', startDate: '2020-07-01', expiryDate: '2047-07-01', link: 'https://www.swda.gov.sg/SGUnitedMidCareerPathways-HostOrganisations.html', jobseekerLink: 'https://www.wsg.gov.sg/SGUnitedMidCareerPathways-Trainees.html', }); }); it('should map to Mid-Career Pathways Programme when id is 541008', () => { assert.deepStrictEqual(mapIcmsToMcfScheme(541008), { id: SCHEME_ID.MID_CAREER_PATHWAYS, scheme: 'Mid-Career Pathways Programme', startDate: '2022-03-10', expiryDate: '2052-03-10', link: 'https://www.swda.gov.sg/home/employers-industry-partners/workforce-skills-development/mid-career-pathways-programme-for-host-organisations', jobseekerLink: 'https://www.wsg.gov.sg/home/individuals/attachment-placement-programmes/mid-career-pathways-programme-for-mature-mid-career-individuals', swdaJobseekerLink: 'https://www.swda.gov.sg/home/individuals/attachment-placement-programmes/mid-career-pathways-programme-for-mature-mid-career-individuals', }); }); it('should map to GRaduate Industry Traineeships (GRIT) Programme when id is 541009', () => { assert.deepStrictEqual(mapIcmsToMcfScheme(541009), { id: SCHEME_ID.GRIT, scheme: 'GRaduate Industry Traineeships (GRIT) Programme', startDate: '2025-09-01', expiryDate: '2026-09-30', link: '', jobseekerLink: 'https://www.wsg.gov.sg/home/individuals/attachment-placement-programmes/graduate-industry-traineeships', swdaJobseekerLink: 'https://www.swda.gov.sg/home/individuals/attachment-placement-programmes/graduate-industry-traineeships', }); }); }); describe('mapMcfToIcmsScheme', () => { it('should map to CSP when id is 4', () => { assert.deepStrictEqual(mapMcfToIcmsScheme(SCHEME_ID.CAREER_SUPPORT), {id: 541001, scheme: 'CSP'}); }); it('should map to PCP when id is 2', () => { assert.deepStrictEqual(mapMcfToIcmsScheme(SCHEME_ID.CCP), {id: 541002, scheme: 'CCP'}); }); it('should map to P-Max when id is 1', () => { assert.deepStrictEqual(mapMcfToIcmsScheme(SCHEME_ID.P_MAX), {id: 541003, scheme: 'P-Max'}); }); it('should map to Career Trial when id is 3', () => { assert.deepStrictEqual(mapMcfToIcmsScheme(SCHEME_ID.CAREER_TRIAL), {id: 541005, scheme: 'Career Trial'}); }); it('should map to SGUnited Traineeships when id is 5', () => { assert.deepStrictEqual(mapMcfToIcmsScheme(SCHEME_ID.SG_UNITED_TRAINEESHIPS), { id: 541006, scheme: 'SGUnited Traineeships', }); }); it('should map to SGUnited Mid-Career Pathways Programme when id is 6', () => { assert.deepStrictEqual(mapMcfToIcmsScheme(SCHEME_ID.SG_UNITED_MID_CAREER_PATHWAYS), { id: 541007, scheme: 'SGUnited Mid-Career Pathways Programme', }); }); it('should map to Mid-Career Pathways Programme when id is 7', () => { assert.deepStrictEqual(mapMcfToIcmsScheme(SCHEME_ID.MID_CAREER_PATHWAYS), { id: 541008, scheme: 'Mid-Career Pathways Programme', }); }); it('should map to GRaduate Industry Traineeships (GRIT) Programme when id is 8', () => { assert.deepStrictEqual(mapMcfToIcmsScheme(SCHEME_ID.GRIT), { id: 541009, scheme: 'GRaduate Industry Traineeships (GRIT) Programme', }); }); }); describe('mapMsfToMcfScheme', () => { it('should map to Career Support Programme when id is 01', () => { assert.deepStrictEqual(mapMsfToMcfScheme('01'), { id: SCHEME_ID.CAREER_SUPPORT, scheme: 'Career Support Programme', startDate: '1977-05-25', expiryDate: '2055-05-04', link: 'http://www.swda.gov.sg/programmes-and-initiatives/wsg-career-support-programme-employers.html', jobseekerLink: 'http://www.wsg.gov.sg/programmes-and-initiatives/wsg-career-support-programme-individuals.html', }); }); it('should map to Career Conversion Programme when id is 05', () => { assert.deepStrictEqual(mapMsfToMcfScheme('05'), { id: SCHEME_ID.CCP, scheme: 'Career Conversion Programme', startDate: '1977-05-25', expiryDate: '2055-05-04', link: 'https://www.swda.gov.sg/home/employers-industry-partners/workforce-skills-development/career-conversion-programmes-employers', jobseekerLink: 'https://conversion.mycareersfuture.gov.sg/Portal/ProgramListing.aspx?Source=PCP', }); }); it('should map to P-Max when id is 02', () => { assert.deepStrictEqual(mapMsfToMcfScheme('02'), { id: SCHEME_ID.P_MAX, scheme: 'P-Max', startDate: '1977-05-25', expiryDate: '2055-05-04', link: 'http://www.swda.gov.sg/programmes-and-initiatives/p-max-employer.html', jobseekerLink: 'http://www.wsg.gov.sg/programmes-and-initiatives/p-max-employer.html', }); }); it('should map to Career Trial when id is 06', () => { assert.deepStrictEqual(mapMsfToMcfScheme('06'), { id: SCHEME_ID.CAREER_TRIAL, scheme: 'Career Trial', startDate: '1977-05-25', expiryDate: '2055-05-04', link: 'http://www.swda.gov.sg/programmes-and-initiatives/career-trial-employers.html', jobseekerLink: 'https://programmes.mycareersfuture.gov.sg/CareerTrialJobseekers/ProgrammeDetails.aspx', }); }); it('should map to SGUnited Traineeships when id is 07', () => { assert.deepStrictEqual(mapMsfToMcfScheme('07'), { id: SCHEME_ID.SG_UNITED_TRAINEESHIPS, scheme: 'SGUnited Traineeships', startDate: '2020-06-01', expiryDate: '2047-06-01', link: 'https://www.swda.gov.sg/SGUnitedTraineeships-HostCompanies.html', jobseekerLink: 'https://www.wsg.gov.sg/SGUnitedTraineeships-Trainees.html', }); }); it('should map to SGUnited Mid-Career Pathways Programme when id is 08', () => { assert.deepStrictEqual(mapMsfToMcfScheme('08'), { id: SCHEME_ID.SG_UNITED_MID_CAREER_PATHWAYS, scheme: 'SGUnited Mid-Career Pathways Programme', startDate: '2020-07-01', expiryDate: '2047-07-01', link: 'https://www.swda.gov.sg/SGUnitedMidCareerPathways-HostOrganisations.html', jobseekerLink: 'https://www.wsg.gov.sg/SGUnitedMidCareerPathways-Trainees.html', }); }); it('should map to Mid-Career Pathways Programme when id is 09', () => { assert.deepStrictEqual(mapMsfToMcfScheme('09'), { id: SCHEME_ID.MID_CAREER_PATHWAYS, scheme: 'Mid-Career Pathways Programme', startDate: '2022-03-10', expiryDate: '2052-03-10', link: 'https://www.swda.gov.sg/home/employers-industry-partners/workforce-skills-development/mid-career-pathways-programme-for-host-organisations', jobseekerLink: 'https://www.wsg.gov.sg/home/individuals/attachment-placement-programmes/mid-career-pathways-programme-for-mature-mid-career-individuals', swdaJobseekerLink: 'https://www.swda.gov.sg/home/individuals/attachment-placement-programmes/mid-career-pathways-programme-for-mature-mid-career-individuals', }); }); it('should map to GRaduate Industry Traineeships (GRIT) Programme when id is 10', () => { assert.deepStrictEqual(mapMsfToMcfScheme('10'), { id: SCHEME_ID.GRIT, scheme: 'GRaduate Industry Traineeships (GRIT) Programme', startDate: '2025-09-01', expiryDate: '2026-09-30', link: '', jobseekerLink: 'https://www.wsg.gov.sg/home/individuals/attachment-placement-programmes/graduate-industry-traineeships', swdaJobseekerLink: 'https://www.swda.gov.sg/home/individuals/attachment-placement-programmes/graduate-industry-traineeships', }); }); }); describe('mapMcfToMsfScheme', () => { it('should map to CSP when id is 4', () => { assert.deepStrictEqual(mapMcfToMsfScheme(SCHEME_ID.CAREER_SUPPORT), {id: '01', programme: 'CSP'}); }); it('should map to PCP when id is 2', () => { assert.deepStrictEqual(mapMcfToMsfScheme(SCHEME_ID.CCP), {id: '05', programme: 'CCP'}); }); it('should map to P-Max when id is 1', () => { assert.deepStrictEqual(mapMcfToMsfScheme(SCHEME_ID.P_MAX), {id: '02', programme: 'P-Max'}); }); it('should map to Career Trial when id is 3', () => { assert.deepStrictEqual(mapMcfToMsfScheme(SCHEME_ID.CAREER_TRIAL), {id: '06', programme: 'Career Trial'}); }); it('should map to SGUnited Traineeships when id is 5', () => { assert.deepStrictEqual(mapMcfToMsfScheme(SCHEME_ID.SG_UNITED_TRAINEESHIPS), { id: '07', programme: 'SGUnited Traineeships', }); }); it('should map to SGUnited Mid-Career Pathways Programme when id is 6', () => { assert.deepStrictEqual(mapMcfToMsfScheme(SCHEME_ID.SG_UNITED_MID_CAREER_PATHWAYS), { id: '08', programme: 'SGUnited Mid-Career Pathways Programme', }); }); it('should map to SGUnited Mid-Career Pathways Programme when id is 7', () => { assert.deepStrictEqual(mapMcfToMsfScheme(SCHEME_ID.MID_CAREER_PATHWAYS), { id: '09', programme: 'Mid-Career Pathways Programme', }); }); it('should map to GRaduate Industry Traineeships (GRIT) Programmewhenwhen id is 8', () => { assert.deepStrictEqual(mapMcfToMsfScheme(SCHEME_ID.GRIT), { id: '10', programme: 'GRaduate Industry Traineeships (GRIT) Programme', }); }); });