mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Added clone challenge test
This commit is contained in:
@@ -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 );
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user