mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
API: Adding secret.text to the user-schema (#12121)
This commit is contained in:
@@ -117,4 +117,24 @@ describe('POST /user/reset', () => {
|
||||
expect(userChallengeTask).to.exist;
|
||||
expect(syncedGroupTask).to.exist;
|
||||
});
|
||||
|
||||
it('does not delete secret', async () => {
|
||||
const admin = await generateUser({
|
||||
contributor: { admin: true },
|
||||
});
|
||||
|
||||
const hero = await generateUser({
|
||||
contributor: { level: 1 },
|
||||
secret: {
|
||||
text: 'Super-Hero',
|
||||
},
|
||||
});
|
||||
|
||||
await hero.post('/user/reset');
|
||||
|
||||
const heroRes = await admin.get(`/hall/heroes/${hero.auth.local.username}`);
|
||||
|
||||
expect(heroRes.secret).to.exist;
|
||||
expect(heroRes.secret.text).to.be.eq('Super-Hero');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user