mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
wip(shared): port sleep op
This commit is contained in:
18
test/common/ops/sleep.js
Normal file
18
test/common/ops/sleep.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import sleep from '../../../common/script/ops/sleep';
|
||||
import {
|
||||
generateUser,
|
||||
} from '../../helpers/common.helper';
|
||||
|
||||
describe('shared.ops.sleep', () => {
|
||||
it('changes user.preferences.sleep and returns the new value', () => {
|
||||
let user = generateUser();
|
||||
|
||||
let res = sleep(user);
|
||||
expect(res).to.equal(true);
|
||||
expect(user.preferences.sleep).to.equal(true);
|
||||
|
||||
let res2 = sleep(user);
|
||||
expect(res2).to.equal(false);
|
||||
expect(user.preferences.sleep).to.equal(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user