message: Add: Test for export as student
diff: @@ -159,7 +159,7 @@ describe('DownloadFile', () => {
  .catch(err => err.response);
  res.status.should.be.equal(500);
  });
  - it('should pass', async () => {
  + it('should pass (course admin)', async () => {
  const course = await FixtureUtils.getRandomCourseWithAllUnitTypes();
  const teacher = await User.findById(course.courseAdmin);
  const lectures: any[] = [];
  @@ -188,6 +188,35 @@ describe('DownloadFile', () => {
  expect(res).to.have.status(200);
  expect(res).to.be.json;
  }).timeout(30000);
  + it('should pass (student)', async () => {
  + const course = await FixtureUtils.getRandomCourseWithAllUnitTypes();
  + const student = await User.findById(course.students.pop());
  + const lectures: any[] = [];
  + for (const lec of course.lectures) {
  + const lecture = await Lecture.findById(lec);
  + const units: any[] = [];
  + for (const unitId of lecture.units) {
  + const temp: any = {};
  + temp['unitId'] = unitId;
  + units.push(temp);
  + }
  + const tempLec: any = {};
  + tempLec['lectureId'] = lec;
  + tempLec['units'] = units;
  + lectures.push(tempLec);
  + }
  + const testData = {
  + 'courseName': course._id,
  + 'lectures': lectures
  + };
  + const res = await chai.request(app)
  + .post(BASE_URL + '/pdf/individual')
  + .set('Cookie', `token=${JwtUtils.generateToken(student)}`)
  + .send(testData)
  + .catch(err => err.response);
  + expect(res).to.have.status(200);
  + expect(res).to.be.json;
  + }).timeout(30000);
  });
  describe(`POST ${BASE_URL + '/pdf/single'}`, () => {
  