Files
habitica/test/common/ops/sleep.js
Matteo Pagliazzi 85fb5f33aa fix test lint
2019-10-08 20:45:38 +02:00

19 lines
483 B
JavaScript

import sleep from '../../../website/common/script/ops/sleep';
import {
generateUser,
} from '../../helpers/common.helper';
describe('shared.ops.sleep', () => {
it('toggles user.preferences.sleep', () => {
const user = generateUser();
const [res] = sleep(user);
expect(res).to.eql(true);
expect(user.preferences.sleep).to.equal(true);
const [res2] = sleep(user);
expect(res2).to.eql(false);
expect(user.preferences.sleep).to.equal(false);
});
});