mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
fixes #11047 Switches Hall query to use lowercase name
This commit is contained in:
@@ -54,7 +54,7 @@ describe('GET /heroes/:heroId', () => {
|
||||
expect(heroRes.profile).to.have.all.keys(['name']);
|
||||
});
|
||||
|
||||
it('returns only necessary hero data given username', async () => {
|
||||
it('returns only necessary hero data given username with display case', async () => {
|
||||
let hero = await generateUser({
|
||||
contributor: {tier: 23},
|
||||
});
|
||||
@@ -67,4 +67,16 @@ describe('GET /heroes/:heroId', () => {
|
||||
expect(heroRes.auth.local).not.to.have.keys(['salt', 'hashed_password']);
|
||||
expect(heroRes.profile).to.have.all.keys(['name']);
|
||||
});
|
||||
|
||||
it('returns hero data given username without case sensitivity', async () => {
|
||||
let hero = await generateUser({}, 'TestUpperCaseName123');
|
||||
let heroRes = await user.get(`/hall/heroes/${hero.auth.local.username.toLowerCase()}`);
|
||||
|
||||
expect(heroRes).to.have.all.keys([
|
||||
'_id', 'id', 'balance', 'profile', 'purchased',
|
||||
'contributor', 'auth', 'items',
|
||||
]);
|
||||
expect(heroRes.auth.local).not.to.have.keys(['salt', 'hashed_password']);
|
||||
expect(heroRes.profile).to.have.all.keys(['name']);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user