mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
wip(shared): adapt to v3
This commit is contained in:
34
test/common_old/user.ops.test.js
Normal file
34
test/common_old/user.ops.test.js
Normal file
@@ -0,0 +1,34 @@
|
||||
let shared = require('../../common/script/index.js');
|
||||
|
||||
describe('user.ops', () => {
|
||||
let user;
|
||||
|
||||
beforeEach(() => {
|
||||
user = {
|
||||
items: {
|
||||
gear: { },
|
||||
special: { },
|
||||
},
|
||||
achievements: { },
|
||||
flags: { },
|
||||
};
|
||||
|
||||
shared.wrap(user);
|
||||
});
|
||||
|
||||
describe('readCard', () => {
|
||||
it('removes card from invitation array', () => {
|
||||
user.items.special.valentineReceived = ['Leslie'];
|
||||
user.ops.readCard({ params: { cardType: 'valentine' } });
|
||||
|
||||
expect(user.items.special.valentineReceived).to.be.empty;
|
||||
});
|
||||
|
||||
it('removes the first card from invitation array', () => {
|
||||
user.items.special.valentineReceived = ['Leslie', 'Vicky'];
|
||||
user.ops.readCard({ params: { cardType: 'valentine' } });
|
||||
|
||||
expect(user.items.special.valentineReceived).to.eql(['Vicky']);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user