<commit_before>/**
 * @author    <NAME> <<EMAIL>>
 * @copyright Copyright (c) 2016
 * @license   GPL-3.0
 */

'use strict';

export default function (request, context) {
  describe('Schedules', () => {
    it('should not fetch schedules if token is invalid', async() => {
      await request.get('/api/schedules')
        .set({
          Accept: 'application/json',
          Authorization: 'Bearer 0'
        })
        .expect(401);
    });

    it('should fetch all schedules', async() => {
      const { token } = context;
      const req = await request.get('/api/schedules')
        .set({
          Accept: 'application/json',
          Authorization: `Bearer ${token}`
        })
        .expect(200)
        .expect('Content-Type', /json/);

      const schedules = req.res.body;
      schedules.should.to.be.instanceOf(Array);
      schedules[0].should.have.property('_id');
      schedules[0].should.have.property('date');
      schedules[0].should.have.property('groups');
    });
  });
}<commit_msg>test(schedule): add asserts in schedule test<commit_after>/**
 * @author    <NAME> <<EMAIL>>
 * @copyright Copyright (c) 2016
 * @license   GPL-3.0
 */

'use strict';

export default function (request, context) {
  describe('Schedules', () => {
    it('should not fetch schedules if token is invalid', async() => {
      await request.get('/api/schedules')
        .set({
          Accept: 'application/json',
          Authorization: 'Bearer 0'
        })
        .expect(401);
    });

    it('should fetch all schedules', async() => {
      const { token } = context;
      const req = await request.get('/api/schedules')
        .set({
          Accept: 'application/json',
          Authorization: `Bearer ${token}`
        })
        .expect(200)
        .expect('Content-Type', /json/);

      const schedules = req.res.body;
      schedules.should.to.be.instanceOf(Array);
      schedules[0].should.have.property('_id');
      schedules[0].should.have.property('date');
      schedules[0].should.have.property('groups');
      schedules[0].groups[0].should.have.property('time');
      schedules[0].groups[0].sessions[0].should.have.property('name');
      schedules[0].groups[0].sessions[0].should.have.property('location');
    });
  });
}
{'fraction_non_alphanumeric': 0.17506631299734748, 'fraction_numerical': 0.01768346595932803, 'mean_word_length': 2.5525902668759812, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6584295', 'n_tokens_mistral': 715, 'n_tokens_neox': 680, 'n_words': 136}