import CS4238Timetable from './fixtures/api-timetable/CS4238.json' ; import MA2213Timetable from './fixtures/api-timetable/MA2213.json' ; import CS2100Timetable from './fixtures/api-timetable/CS2100_2.json' ; import CN4205ETimetable from './fixtures/api-timetable/CN4205E.json' ; import CS1010XTimetable from './fixtures/api-timetable/CS1010X.json' ; import RE5001Timetable from './fixtures/api-timetable/RE5001.json' ; import GetSemesterTimetable , { transformModgrpToClassNo } from './GetSemesterTimetable' ; import { TimetableLesson } from '../types/api' ; import { Semester } from '../types/modules' ; jest . mock ( '../services/io/elastic' ) ; describe ( transformModgrpToClassNo , ( ) => { test ( 'should remove activity string prefix from mod group' , ( ) => { expect ( transformModgrpToClassNo ( 'TE1' , 'T' ) ) . toEqual ( 'E1' ) ; expect ( transformModgrpToClassNo ( 'TTE1' , 'T' ) ) . toEqual ( 'TE1' ) ; expect ( transformModgrpToClassNo ( 'LDE1' , 'L' ) ) . toEqual ( 'DE1' ) ; } ) ; test ( 'should passthrough mod groups without activity prefix' , ( ) => { expect ( transformModgrpToClassNo ( 'TDE1' , 'L' ) ) . toEqual ( 'TDE1' ) ; } ) ; test ( 'should trim whitespaces off mod group' , ( ) => { expect ( transformModgrpToClassNo ( 'TDE1 ' , 'L' ) ) . toEqual ( 'TDE1' ) ; } ) ; test ( 'should passthrough mod groups which are just the activity' , ( ) => { expect ( transformModgrpToClassNo ( 'L' , 'L' ) ) . toEqual ( 'L' ) ; expect ( transformModgrpToClassNo ( 'L ' , 'L' ) ) . toEqual ( 'L' ) ; } ) ; } ) ; describe ( GetSemesterTimetable , ( ) => { function createTask ( lessons , semester = 1 ) { const task = new GetSemesterTimetable ( semester , '2018/2019' ) ; task . api . getSemesterTimetables = jest . fn ( ( term , consumer ) => { lessons . forEach ( ( lesson ) => consumer ( lesson ) ) ; return Promise . resolve ( ) ; } ) ; return task ; } test ( 'should map empty timetable lessons' , async ( ) => { const task = createTask ( [ ] ) ; await expect ( task . run ( ) ) . resolves . toEqual ( { } ) ; } ) ; test ( 'should map CN4205E timetable lessons correctly' , async ( ) => { const task = createTask ( CN4205ETimetable ) ; const timetable = await task . run ( ) ; expect ( timetable . CN4205E ) . toMatchInlineSnapshot ( `
      Array [
        Object {
          "classNo": "1",
          "covidZone": "A",
          "day": "Wednesday",
          "endTime": "2030",
          "lessonType": "Lecture",
          "size": 30,
          "startTime": "1800",
          "venue": "E5-03-23",
          "weeks": Object {
            "end": "2018-11-21",
            "start": "2018-08-15",
          },
        },
        Object {
          "classNo": "1",
          "covidZone": "A",
          "day": "Wednesday",
          "endTime": "2130",
          "lessonType": "Tutorial",
          "size": 30,
          "startTime": "2030",
          "venue": "E5-03-23",
          "weeks": Object {
            "end": "2018-11-21",
            "start": "2018-08-15",
          },
        },
      ]
    ` ) ; } ) ; test ( 'should map CS4238 timetable lessons correctly' , async ( ) => { const task = createTask ( CS4238Timetable ) ; const timetable = await task . run ( ) ; expect ( timetable . CS4238 ) . toMatchInlineSnapshot ( `
      Array [
        Object {
          "classNo": "1",
          "covidZone": "A",
          "day": "Monday",
          "endTime": "2030",
          "lessonType": "Lecture",
          "size": 40,
          "startTime": "1830",
          "venue": "COM1-B113",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "2",
          "covidZone": "A",
          "day": "Tuesday",
          "endTime": "2030",
          "lessonType": "Lecture",
          "size": 40,
          "startTime": "1830",
          "venue": "COM1-B113",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "2",
          "covidZone": "A",
          "day": "Tuesday",
          "endTime": "2130",
          "lessonType": "Laboratory",
          "size": 40,
          "startTime": "2030",
          "venue": "COM1-B113",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "1",
          "covidZone": "A",
          "day": "Monday",
          "endTime": "2130",
          "lessonType": "Laboratory",
          "size": 40,
          "startTime": "2030",
          "venue": "COM1-B113",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
      ]
    ` ) ; } ) ; test ( 'should map MA2213 timetable lessons correctly' , async ( ) => { const task = createTask ( MA2213Timetable ) ; const timetable = await task . run ( ) ; expect ( timetable . MA2213 ) . toMatchInlineSnapshot ( `
      Array [
        Object {
          "classNo": "1",
          "covidZone": "A",
          "day": "Wednesday",
          "endTime": "1200",
          "lessonType": "Lecture",
          "size": 232,
          "startTime": "1000",
          "venue": "LT33",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "1",
          "covidZone": "A",
          "day": "Monday",
          "endTime": "1000",
          "lessonType": "Lecture",
          "size": 232,
          "startTime": "0800",
          "venue": "LT34",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "2",
          "covidZone": "A",
          "day": "Monday",
          "endTime": "1800",
          "lessonType": "Laboratory",
          "size": 30,
          "startTime": "1700",
          "venue": "S17-0304",
          "weeks": Array [
            3,
            5,
            7,
            9,
            11,
          ],
        },
        Object {
          "classNo": "1",
          "covidZone": "A",
          "day": "Tuesday",
          "endTime": "1200",
          "lessonType": "Tutorial",
          "size": 30,
          "startTime": "1100",
          "venue": "S17-0404",
          "weeks": Array [
            4,
            6,
            8,
            10,
            12,
          ],
        },
        Object {
          "classNo": "4",
          "covidZone": "A",
          "day": "Wednesday",
          "endTime": "1500",
          "lessonType": "Tutorial",
          "size": 30,
          "startTime": "1400",
          "venue": "S17-0404",
          "weeks": Array [
            4,
            6,
            8,
            10,
            12,
          ],
        },
        Object {
          "classNo": "2",
          "covidZone": "A",
          "day": "Monday",
          "endTime": "1800",
          "lessonType": "Tutorial",
          "size": 30,
          "startTime": "1700",
          "venue": "S17-0404",
          "weeks": Array [
            4,
            6,
            8,
            10,
            12,
          ],
        },
        Object {
          "classNo": "1",
          "covidZone": "A",
          "day": "Tuesday",
          "endTime": "1200",
          "lessonType": "Laboratory",
          "size": 30,
          "startTime": "1100",
          "venue": "S17-0304",
          "weeks": Array [
            3,
            5,
            7,
            9,
            11,
          ],
        },
        Object {
          "classNo": "3",
          "covidZone": "A",
          "day": "Tuesday",
          "endTime": "1700",
          "lessonType": "Laboratory",
          "size": 30,
          "startTime": "1600",
          "venue": "S17-0304",
          "weeks": Array [
            3,
            5,
            7,
            9,
            11,
          ],
        },
        Object {
          "classNo": "3",
          "covidZone": "A",
          "day": "Tuesday",
          "endTime": "1700",
          "lessonType": "Tutorial",
          "size": 30,
          "startTime": "1600",
          "venue": "S17-0611",
          "weeks": Array [
            4,
            6,
            8,
            10,
            12,
          ],
        },
        Object {
          "classNo": "4",
          "covidZone": "A",
          "day": "Wednesday",
          "endTime": "1500",
          "lessonType": "Laboratory",
          "size": 30,
          "startTime": "1400",
          "venue": "S17-0304",
          "weeks": Array [
            3,
            5,
            7,
            9,
            11,
          ],
        },
      ]
    ` ) ; } ) ; test ( 'should map CS2100 timetable lessons correctly' , async ( ) => { const task = createTask ( CS2100Timetable , 2 ) ; const timetable = await task . run ( ) ; expect ( timetable . CS2100 ) . toMatchInlineSnapshot ( `
      Array [
        Object {
          "classNo": "2",
          "covidZone": "A",
          "day": "Wednesday",
          "endTime": "1600",
          "lessonType": "Lecture",
          "size": 200,
          "startTime": "1500",
          "venue": "I3-AUD",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "13",
          "covidZone": "A",
          "day": "Wednesday",
          "endTime": "1100",
          "lessonType": "Tutorial",
          "size": 20,
          "startTime": "1000",
          "venue": "COM1-0207",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "14",
          "covidZone": "A",
          "day": "Tuesday",
          "endTime": "1200",
          "lessonType": "Tutorial",
          "size": 20,
          "startTime": "1100",
          "venue": "COM1-0209",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "01",
          "covidZone": "A",
          "day": "Wednesday",
          "endTime": "1200",
          "lessonType": "Tutorial",
          "size": 20,
          "startTime": "1100",
          "venue": "COM1-0207",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "12",
          "covidZone": "A",
          "day": "Thursday",
          "endTime": "1800",
          "lessonType": "Tutorial",
          "size": 20,
          "startTime": "1700",
          "venue": "COM1-0207",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "15",
          "covidZone": "A",
          "day": "Friday",
          "endTime": "0900",
          "lessonType": "Tutorial",
          "size": 20,
          "startTime": "0800",
          "venue": "COM1-0209",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "17",
          "covidZone": "A",
          "day": "Wednesday",
          "endTime": "1400",
          "lessonType": "Tutorial",
          "size": 20,
          "startTime": "1300",
          "venue": "COM1-0209",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "18",
          "covidZone": "A",
          "day": "Friday",
          "endTime": "1400",
          "lessonType": "Tutorial",
          "size": 20,
          "startTime": "1300",
          "venue": "COM1-0209",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "19",
          "covidZone": "A",
          "day": "Friday",
          "endTime": "1500",
          "lessonType": "Tutorial",
          "size": 20,
          "startTime": "1400",
          "venue": "COM1-0209",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "20",
          "covidZone": "A",
          "day": "Friday",
          "endTime": "1600",
          "lessonType": "Tutorial",
          "size": 20,
          "startTime": "1500",
          "venue": "COM1-0209",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "05",
          "covidZone": "A",
          "day": "Friday",
          "endTime": "1200",
          "lessonType": "Tutorial",
          "size": 20,
          "startTime": "1100",
          "venue": "COM1-0209",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "02",
          "covidZone": "A",
          "day": "Friday",
          "endTime": "1000",
          "lessonType": "Tutorial",
          "size": 20,
          "startTime": "0900",
          "venue": "COM1-0209",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "16",
          "covidZone": "A",
          "day": "Wednesday",
          "endTime": "1300",
          "lessonType": "Tutorial",
          "size": 20,
          "startTime": "1200",
          "venue": "COM1-0209",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "2",
          "covidZone": "A",
          "day": "Monday",
          "endTime": "1200",
          "lessonType": "Lecture",
          "size": 200,
          "startTime": "1000",
          "venue": "I3-AUD",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "1",
          "covidZone": "A",
          "day": "Wednesday",
          "endTime": "1500",
          "lessonType": "Lecture",
          "size": 200,
          "startTime": "1400",
          "venue": "I3-AUD",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "1",
          "covidZone": "A",
          "day": "Tuesday",
          "endTime": "1800",
          "lessonType": "Lecture",
          "size": 200,
          "startTime": "1600",
          "venue": "I3-AUD",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "11",
          "covidZone": "A",
          "day": "Monday",
          "endTime": "1600",
          "lessonType": "Tutorial",
          "size": 20,
          "startTime": "1500",
          "venue": "COM1-0203",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "10",
          "covidZone": "A",
          "day": "Tuesday",
          "endTime": "1000",
          "lessonType": "Tutorial",
          "size": 20,
          "startTime": "0900",
          "venue": "COM1-0201",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "13",
          "covidZone": "A",
          "day": "Thursday",
          "endTime": "1100",
          "lessonType": "Laboratory",
          "size": 20,
          "startTime": "1000",
          "venue": "COM1-0113",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "19",
          "covidZone": "A",
          "day": "Thursday",
          "endTime": "1700",
          "lessonType": "Laboratory",
          "size": 20,
          "startTime": "1600",
          "venue": "COM1-0113",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "06",
          "covidZone": "A",
          "day": "Friday",
          "endTime": "1300",
          "lessonType": "Tutorial",
          "size": 20,
          "startTime": "1200",
          "venue": "COM1-0209",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "04",
          "covidZone": "A",
          "day": "Wednesday",
          "endTime": "1200",
          "lessonType": "Tutorial",
          "size": 20,
          "startTime": "1100",
          "venue": "COM1-0201",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "09",
          "covidZone": "A",
          "day": "Monday",
          "endTime": "1700",
          "lessonType": "Laboratory",
          "size": 20,
          "startTime": "1600",
          "venue": "COM1-0113",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "20",
          "covidZone": "A",
          "day": "Thursday",
          "endTime": "1800",
          "lessonType": "Laboratory",
          "size": 20,
          "startTime": "1700",
          "venue": "COM1-0113",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "03",
          "covidZone": "A",
          "day": "Tuesday",
          "endTime": "1100",
          "lessonType": "Tutorial",
          "size": 20,
          "startTime": "1000",
          "venue": "COM1-0207",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "05",
          "covidZone": "A",
          "day": "Monday",
          "endTime": "1300",
          "lessonType": "Laboratory",
          "size": 20,
          "startTime": "1200",
          "venue": "COM1-0113",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "06",
          "covidZone": "A",
          "day": "Monday",
          "endTime": "1400",
          "lessonType": "Laboratory",
          "size": 20,
          "startTime": "1300",
          "venue": "COM1-0113",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "07",
          "covidZone": "A",
          "day": "Monday",
          "endTime": "1500",
          "lessonType": "Laboratory",
          "size": 20,
          "startTime": "1400",
          "venue": "COM1-0113",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "08",
          "covidZone": "A",
          "day": "Monday",
          "endTime": "1600",
          "lessonType": "Laboratory",
          "size": 20,
          "startTime": "1500",
          "venue": "COM1-0113",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "08",
          "covidZone": "A",
          "day": "Monday",
          "endTime": "1300",
          "lessonType": "Tutorial",
          "size": 20,
          "startTime": "1200",
          "venue": "COM1-0207",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "02",
          "covidZone": "A",
          "day": "Monday",
          "endTime": "1000",
          "lessonType": "Laboratory",
          "size": 20,
          "startTime": "0900",
          "venue": "COM1-0113",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "03",
          "covidZone": "A",
          "day": "Monday",
          "endTime": "1100",
          "lessonType": "Laboratory",
          "size": 20,
          "startTime": "1000",
          "venue": "COM1-0113",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "04",
          "covidZone": "A",
          "day": "Monday",
          "endTime": "1200",
          "lessonType": "Laboratory",
          "size": 20,
          "startTime": "1100",
          "venue": "COM1-0113",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "16",
          "covidZone": "A",
          "day": "Thursday",
          "endTime": "1400",
          "lessonType": "Laboratory",
          "size": 20,
          "startTime": "1300",
          "venue": "COM1-0113",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "17",
          "covidZone": "A",
          "day": "Thursday",
          "endTime": "1500",
          "lessonType": "Laboratory",
          "size": 20,
          "startTime": "1400",
          "venue": "COM1-0113",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "18",
          "covidZone": "A",
          "day": "Thursday",
          "endTime": "1600",
          "lessonType": "Laboratory",
          "size": 20,
          "startTime": "1500",
          "venue": "COM1-0113",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "10",
          "covidZone": "A",
          "day": "Monday",
          "endTime": "1800",
          "lessonType": "Laboratory",
          "size": 20,
          "startTime": "1700",
          "venue": "COM1-0113",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "11",
          "covidZone": "A",
          "day": "Thursday",
          "endTime": "0900",
          "lessonType": "Laboratory",
          "size": 20,
          "startTime": "0800",
          "venue": "COM1-0113",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "12",
          "covidZone": "A",
          "day": "Thursday",
          "endTime": "1000",
          "lessonType": "Laboratory",
          "size": 20,
          "startTime": "0900",
          "venue": "COM1-0113",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "14",
          "covidZone": "A",
          "day": "Thursday",
          "endTime": "1200",
          "lessonType": "Laboratory",
          "size": 20,
          "startTime": "1100",
          "venue": "COM1-0113",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "15",
          "covidZone": "A",
          "day": "Thursday",
          "endTime": "1300",
          "lessonType": "Laboratory",
          "size": 20,
          "startTime": "1200",
          "venue": "COM1-0113",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "07",
          "covidZone": "A",
          "day": "Tuesday",
          "endTime": "1400",
          "lessonType": "Tutorial",
          "size": 20,
          "startTime": "1300",
          "venue": "COM1-0209",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "09",
          "covidZone": "A",
          "day": "Monday",
          "endTime": "1700",
          "lessonType": "Tutorial",
          "size": 20,
          "startTime": "1600",
          "venue": "COM1-0203",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
        Object {
          "classNo": "01",
          "covidZone": "A",
          "day": "Monday",
          "endTime": "0900",
          "lessonType": "Laboratory",
          "size": 20,
          "startTime": "0800",
          "venue": "COM1-0113",
          "weeks": Array [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
          ],
        },
      ]
    ` ) ; } ) ; test ( 'should map CS1010X timetable lessons correctly' , async ( ) => { const task = createTask ( CS1010XTimetable as TimetableLesson [ ] ) ; const output = await task . run ( ) ; expect ( output ) . toMatchInlineSnapshot ( `
      Object {
        "CS1010X": Array [
          Object {
            "classNo": "1",
            "covidZone": "A",
            "day": "Thursday",
            "endTime": "1000",
            "lessonType": "Recitation",
            "size": 48,
            "startTime": "0900",
            "venue": "SR_LT19",
            "weeks": Object {
              "end": "2019-06-20",
              "start": "2019-01-17",
            },
          },
          Object {
            "classNo": "2",
            "covidZone": "A",
            "day": "Thursday",
            "endTime": "1300",
            "lessonType": "Recitation",
            "size": 48,
            "startTime": "1200",
            "venue": "SR_LT19",
            "weeks": Object {
              "end": "2019-06-20",
              "start": "2019-01-17",
            },
          },
          Object {
            "classNo": "01",
            "covidZone": "A",
            "day": "Thursday",
            "endTime": "1100",
            "lessonType": "Tutorial",
            "size": 20,
            "startTime": "1000",
            "venue": "SR_LT19",
            "weeks": Object {
              "end": "2019-06-20",
              "start": "2019-01-17",
            },
          },
          Object {
            "classNo": "02",
            "covidZone": "A",
            "day": "Thursday",
            "endTime": "1200",
            "lessonType": "Tutorial",
            "size": 20,
            "startTime": "1100",
            "venue": "SR_LT19",
            "weeks": Object {
              "end": "2019-06-20",
              "start": "2019-01-17",
            },
          },
          Object {
            "classNo": "03",
            "covidZone": "A",
            "day": "Thursday",
            "endTime": "1400",
            "lessonType": "Tutorial",
            "size": 20,
            "startTime": "1300",
            "venue": "SR_LT19",
            "weeks": Object {
              "end": "2019-06-20",
              "start": "2019-01-17",
            },
          },
          Object {
            "classNo": "04",
            "covidZone": "A",
            "day": "Thursday",
            "endTime": "1500",
            "lessonType": "Tutorial",
            "size": 20,
            "startTime": "1400",
            "venue": "SR_LT19",
            "weeks": Object {
              "end": "2019-06-20",
              "start": "2019-01-17",
            },
          },
        ],
      }
    ` ) ; } ) ; test ( 'should map RE5001 timetable lessons correctly' , async ( ) => { const task = createTask ( RE5001Timetable ) ; const output = await task . run ( ) ; expect ( output ) . toMatchInlineSnapshot ( `
      Object {
        "RE5001": Array [
          Object {
            "classNo": "1",
            "covidZone": "Unknown",
            "day": "Tuesday",
            "endTime": "1800",
            "lessonType": "Lecture",
            "size": 60,
            "startTime": "0900",
            "venue": "SDE-423",
            "weeks": Object {
              "end": "2018-08-07",
              "start": "2018-08-07",
            },
          },
          Object {
            "classNo": "1",
            "covidZone": "Unknown",
            "day": "Wednesday",
            "endTime": "1800",
            "lessonType": "Lecture",
            "size": 60,
            "startTime": "0900",
            "venue": "SDE-423",
            "weeks": Object {
              "end": "2018-08-08",
              "start": "2018-08-08",
            },
          },
          Object {
            "classNo": "1",
            "covidZone": "Unknown",
            "day": "Monday",
            "endTime": "1800",
            "lessonType": "Lecture",
            "size": 60,
            "startTime": "0900",
            "venue": "SDE-423",
            "weeks": Object {
              "end": "2018-08-06",
              "start": "2018-08-06",
            },
          },
          Object {
            "classNo": "1",
            "covidZone": "Unknown",
            "day": "Friday",
            "endTime": "1800",
            "lessonType": "Lecture",
            "size": 60,
            "startTime": "0900",
            "venue": "SDE-423",
            "weeks": Object {
              "end": "2018-08-10",
              "start": "2018-08-10",
            },
          },
          Object {
            "classNo": "1",
            "covidZone": "Unknown",
            "day": "Saturday",
            "endTime": "1300",
            "lessonType": "Lecture",
            "size": 60,
            "startTime": "0900",
            "venue": "SDE-423",
            "weeks": Object {
              "end": "2018-08-11",
              "start": "2018-08-11",
            },
          },
        ],
      }
    ` ) ; } ) ; } ) ;