wip(shared): port sleep op

This commit is contained in:
Matteo Pagliazzi
2016-03-15 16:33:44 +01:00
parent f55df39fb7
commit 490c6a9ae1
7 changed files with 50 additions and 6 deletions

18
test/common/ops/sleep.js Normal file
View 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);
});
});