mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-13 15:38:59 +00:00
chore: Provide additional tests for local login defaults
This commit is contained in:
parent
97417c626a
commit
f275265c2b
2 changed files with 20 additions and 1 deletions
|
|
@ -33,6 +33,25 @@ describe('POST /user/auth/local/register', () => {
|
|||
expect(user.auth.local.username).to.eql(username);
|
||||
});
|
||||
|
||||
it('provides default tags and tasks', async () => {
|
||||
let username = generateRandomUserName();
|
||||
let email = `${username}@example.com`;
|
||||
let password = 'password';
|
||||
|
||||
let user = await api.post('/user/auth/local/register', {
|
||||
username,
|
||||
email,
|
||||
password,
|
||||
confirmPassword: password,
|
||||
});
|
||||
|
||||
expect(user.tags).to.have.a.lengthOf(7);
|
||||
expect(user.tasksOrder.todos).to.have.a.lengthOf(1);
|
||||
expect(user.tasksOrder.dailys).to.have.a.lengthOf(0);
|
||||
expect(user.tasksOrder.rewards).to.have.a.lengthOf(0);
|
||||
expect(user.tasksOrder.habits).to.have.a.lengthOf(0);
|
||||
});
|
||||
|
||||
it('requires password and confirmPassword to match', async () => {
|
||||
let username = generateRandomUserName();
|
||||
let email = `${username}@example.com`;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ describe('POST /user/auth/social', () => {
|
|||
user = await generateUser();
|
||||
|
||||
let expectedResult = {id: facebookId};
|
||||
let passportFacebookProfile = sinon.stub(passport._strategies.facebook, 'userProfile');
|
||||
let passportFacebookProfile = sandbox.stub(passport._strategies.facebook, 'userProfile');
|
||||
passportFacebookProfile.yields(null, expectedResult);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue