<commit_before>import { moduleForModel } from 'ember-qunit';
import moment from 'moment';

import {
  testValidPropertyValues,
  testInvalidPropertyValues
} from '../../helpers/validate-properties';

moduleForModel('appointment', 'Unit | Model | appointment', {
  needs: [
    'ember-validations@validator:local/acceptance',
    'ember-validations@validator:local/presence',
    'model:patient',
    'model:visit',
    'service:session'
  ]
});

testValidPropertyValues('appointmentType', ['test']);
testInvalidPropertyValues('appointmentType', [undefined]);

let today = moment().startOf('day').toDate();
let tomorrow =  moment().startOf('day').add(24, 'hours').toDate();

testValidPropertyValues('startDate', [today], function(subject) {
  Ember.run(() => { subject.set('endDate', tomorrow) });
});

testInvalidPropertyValues('startDate', [tomorrow], function(subject) {
  Ember.run(() => { subject.set('endDate', today) });
});

testValidPropertyValues('endDate', [tomorrow], function(subject) {
  Ember.run(() => { subject.set('startDate', today) });
});

testInvalidPropertyValues('endDate', [today], function(subject) {
  Ember.run(() => { subject.set('startDate', tomorrow) });
});

testInvalidPropertyValues('startDate', [today], function(subject) {
  Ember.run(() => {
  	subject.set('allDay', false);
    subject.set('endDate', today);
  });
});

testValidPropertyValues('startDate', [today], function(subject) {
  Ember.run(() => {
  	subject.set('allDay', true);
    subject.set('endDate', today);
  });
});<commit_msg>Fix for ESLint.<commit_after>import { moduleForModel } from 'ember-qunit';
import { run } from '@ember/runloop';
import moment from 'moment';

import {
  testValidPropertyValues,
  testInvalidPropertyValues
} from '../../helpers/validate-properties';

moduleForModel('appointment', 'Unit | Model | appointment', {
  needs: [
    'ember-validations@validator:local/acceptance',
    'ember-validations@validator:local/presence',
    'model:patient',
    'model:visit',
    'service:session'
  ]
});

testValidPropertyValues('appointmentType', ['test']);
testInvalidPropertyValues('appointmentType', [undefined]);

let today = moment().startOf('day').toDate();
let tomorrow =  moment().startOf('day').add(24, 'hours').toDate();

testValidPropertyValues('startDate', [today], function(subject) {
  run(() => {
    subject.set('endDate', tomorrow);
  });
});

testInvalidPropertyValues('startDate', [tomorrow], function(subject) {
  run(() => {
    subject.set('endDate', today);
  });
});

testValidPropertyValues('endDate', [tomorrow], function(subject) {
  run(() => {
    subject.set('startDate', today);
  });
});

testInvalidPropertyValues('endDate', [today], function(subject) {
  run(() => {
    subject.set('startDate', tomorrow);
  });
});

testInvalidPropertyValues('startDate', [today], function(subject) {
  run(() => {
    subject.set('allDay', false);
    subject.set('endDate', today);
  });
});

testValidPropertyValues('startDate', [today], function(subject) {
  run(() => {
    subject.set('allDay', true);
    subject.set('endDate', today);
  });
});
{'fraction_non_alphanumeric': 0.19896640826873385, 'fraction_numerical': 0.0012919896640826874, 'mean_word_length': 5.688984881209503, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6186103', 'n_tokens_mistral': 955, 'n_tokens_neox': 950, 'n_words': 154}