2016-12-15 16:00:49 +00:00
|
|
|
import {
|
|
|
|
|
generateUser,
|
|
|
|
|
} from '../helpers/common.helper';
|
|
|
|
|
|
2017-03-01 16:10:48 +00:00
|
|
|
import timeTravelers from '../../website/common/script/content/time-travelers';
|
2016-12-15 16:00:49 +00:00
|
|
|
|
|
|
|
|
describe('time-travelers store', () => {
|
2017-03-01 16:10:48 +00:00
|
|
|
let user;
|
|
|
|
|
beforeEach(() => {
|
|
|
|
|
user = generateUser();
|
|
|
|
|
});
|
2016-12-15 16:00:49 +00:00
|
|
|
|
2017-03-01 16:10:48 +00:00
|
|
|
it('removes owned sets from the time travelers store', () => {
|
|
|
|
|
user.items.gear.owned.head_mystery_201602 = true; // eslint-disable-line camelcase
|
|
|
|
|
expect(timeTravelers.timeTravelerStore(user)['201602']).to.not.exist;
|
|
|
|
|
expect(timeTravelers.timeTravelerStore(user)['201603']).to.exist;
|
|
|
|
|
});
|
2016-12-15 16:00:49 +00:00
|
|
|
|
2017-03-01 16:10:48 +00:00
|
|
|
it('removes unopened mystery item sets from the time travelers store', () => {
|
|
|
|
|
user.purchased = {
|
|
|
|
|
plan: {
|
|
|
|
|
mysteryItems: ['head_mystery_201602'],
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
expect(timeTravelers.timeTravelerStore(user)['201602']).to.not.exist;
|
|
|
|
|
expect(timeTravelers.timeTravelerStore(user)['201603']).to.exist;
|
|
|
|
|
});
|
2016-12-15 16:00:49 +00:00
|
|
|
});
|