API: Adding secret.text to the user-schema (#12121)

This commit is contained in:
negue
2020-05-02 19:59:05 +02:00
committed by GitHub
parent 643d3802cc
commit 26767f598b
17 changed files with 177 additions and 22 deletions

View File

@@ -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');
});
});