mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-05-24 14:45:27 +00:00
Added clone challenge test
This commit is contained in:
parent
7890abe31a
commit
c3307dd684
1 changed files with 29 additions and 0 deletions
|
|
@ -182,4 +182,33 @@ describe('Challenges Controller', function() {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('Clones a challenge', function() {
|
||||
var copyChallenge = new challenges.Challenge({
|
||||
name: 'copyChallenge',
|
||||
description: 'copyChallenge',
|
||||
habits: [],
|
||||
dailys: [],
|
||||
todos: [],
|
||||
rewards: [],
|
||||
leader: user._id,
|
||||
group: "copyGroup",
|
||||
timestamp: +(new Date),
|
||||
members: [user],
|
||||
official: false,
|
||||
_isMember: true
|
||||
});
|
||||
scope.clone(copyChallenge)
|
||||
|
||||
expect( scope.obj.name ).to.eql(copyChallenge.name );
|
||||
expect( scope.obj.description ).to.eql(copyChallenge.description );
|
||||
expect( scope.obj.habits ).to.eql(copyChallenge.habits );
|
||||
expect( scope.obj.dailys ).to.eql(copyChallenge.dailys );
|
||||
expect( scope.obj.todos ).to.eql(copyChallenge.todos );
|
||||
expect( scope.obj.rewards ).to.eql(copyChallenge.rewards );
|
||||
expect( scope.obj.leader ).to.eql(copyChallenge.leader );
|
||||
expect( scope.obj.official ).to.eql(copyChallenge.official );
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue