mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
lint: Fix linting errors in api v2 tests
This commit is contained in:
@@ -15,7 +15,7 @@ describe('PUT /user', () => {
|
||||
context('allowed operations', () => {
|
||||
it('updates the user', async () => {
|
||||
let updatedUser = await user.put('/user', {
|
||||
'profile.name' : 'Frodo',
|
||||
'profile.name': 'Frodo',
|
||||
'preferences.costume': true,
|
||||
'stats.hp': 14,
|
||||
});
|
||||
@@ -29,19 +29,19 @@ describe('PUT /user', () => {
|
||||
context('top level protected operations', () => {
|
||||
let protectedOperations = {
|
||||
'gem balance': {balance: 100},
|
||||
'auth': {'auth.blocked': true, 'auth.timestamps.created': new Date()},
|
||||
'contributor': {'contributor.level': 9, 'contributor.admin': true, 'contributor.text': 'some text'},
|
||||
'backer': {'backer.tier': 10, 'backer.npc': 'Bilbo'},
|
||||
'subscriptions': {'purchased.plan.extraMonths': 500, 'purchased.plan.consecutive.trinkets': 1000},
|
||||
auth: {'auth.blocked': true, 'auth.timestamps.created': new Date()},
|
||||
contributor: {'contributor.level': 9, 'contributor.admin': true, 'contributor.text': 'some text'},
|
||||
backer: {'backer.tier': 10, 'backer.npc': 'Bilbo'},
|
||||
subscriptions: {'purchased.plan.extraMonths': 500, 'purchased.plan.consecutive.trinkets': 1000},
|
||||
'customization gem purchases': {'purchased.background.tavern': true, 'purchased.skin.bear': true},
|
||||
'tasks': {todos: [], habits: [], dailys: [], rewards: []},
|
||||
tasks: {todos: [], habits: [], dailys: [], rewards: []},
|
||||
};
|
||||
|
||||
each(protectedOperations, (data, testName) => {
|
||||
it(`does not allow updating ${testName}`, async () => {
|
||||
let errorText = [];
|
||||
each(data, (value, operation) => {
|
||||
errorText.push(t('messageUserOperationProtected', { operation: operation }));
|
||||
errorText.push(t('messageUserOperationProtected', { operation }));
|
||||
});
|
||||
|
||||
await expect(user.put('/user', data)).to.eventually.be.rejected.and.eql({
|
||||
@@ -61,7 +61,7 @@ describe('PUT /user', () => {
|
||||
it(`does not allow updating ${testName}`, async () => {
|
||||
let errorText = [];
|
||||
each(data, (value, operation) => {
|
||||
errorText.push(t('messageUserOperationProtected', { operation: operation }));
|
||||
errorText.push(t('messageUserOperationProtected', { operation }));
|
||||
});
|
||||
|
||||
await expect(user.put('/user', data)).to.eventually.be.rejected.and.eql({
|
||||
|
||||
Reference in New Issue
Block a user