mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 06:07:21 +01:00
19 lines
483 B
JavaScript
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);
|
|
});
|
|
});
|