lint fixes

This commit is contained in:
Ulf Gebhardt 2021-04-26 02:21:50 +02:00
parent c6fd705748
commit 8a53bda51c
No known key found for this signature in database
GPG Key ID: 81308EFE29ABFEBD
11 changed files with 24 additions and 30 deletions

View File

@ -3,7 +3,7 @@ import Basic from './basic.vue'
const localVue = global.localVue
config.stubs['nuxt'] = '<span><slot /></span>'
config.stubs.nuxt = '<span><slot /></span>'
describe('basic.vue', () => {
let wrapper

View File

@ -3,7 +3,7 @@ import Blank from './blank.vue'
const localVue = global.localVue
config.stubs['nuxt'] = '<span><slot /></span>'
config.stubs.nuxt = '<span><slot /></span>'
describe('blank.vue', () => {
let wrapper

View File

@ -4,7 +4,7 @@ import Default from './default.vue'
const localVue = global.localVue
config.stubs['nuxt'] = '<span><slot /></span>'
config.stubs.nuxt = '<span><slot /></span>'
config.stubs['client-only'] = '<span><slot /></span>'
config.stubs['nuxt-link'] = '<span><slot /></span>'
@ -17,7 +17,7 @@ describe('default.vue', () => {
mocks = {
$t: jest.fn(),
$env: {
INVITE_REGISTRATION: true
INVITE_REGISTRATION: true,
},
}
store = new Vuex.Store({

View File

@ -12,7 +12,7 @@ describe('invite.vue', () => {
$t: jest.fn(),
$apollo: {
loading: false,
}
},
}
})

View File

@ -12,7 +12,7 @@ describe('notifications.vue', () => {
$t: jest.fn(),
$apollo: {
loading: false,
}
},
}
})

View File

@ -12,7 +12,7 @@ describe('organizations.vue', () => {
$t: jest.fn(),
$apollo: {
loading: false,
}
},
}
})

View File

@ -12,7 +12,7 @@ describe('pages.vue', () => {
$t: jest.fn(),
$apollo: {
loading: false,
}
},
}
})

View File

@ -12,7 +12,7 @@ describe('settings.vue', () => {
$t: jest.fn(),
$apollo: {
loading: false,
}
},
}
})

View File

@ -16,7 +16,6 @@ describe('Login.vue', () => {
let tosVersion
let redirect
beforeEach(() => {
mutations = {
// 'posts/SELECT_ORDER': jest.fn(),
@ -46,11 +45,11 @@ describe('Login.vue', () => {
const data = login.data ? login.data() : {}
const aData = await login.asyncData({
store,
redirect
redirect,
})
login.data = function() {
return { ...data, ...aData};
};
login.data = function () {
return { ...data, ...aData }
}
}
return mount(login, {
store,
@ -76,7 +75,5 @@ describe('Login.vue', () => {
wrapper = await Wrapper()
expect(redirect).toBeCalledWith('/')
})
})
})

View File

@ -15,7 +15,6 @@ describe('password-reset.vue', () => {
let redirect
let isLoggedIn
beforeEach(() => {
mocks = {
$t: (t) => t,
@ -28,7 +27,7 @@ describe('password-reset.vue', () => {
redirect = jest.fn()
})
describe('mount', () => {
describe('mount', () => {
const Wrapper = async () => {
store = new Vuex.Store({
getters: {
@ -39,11 +38,11 @@ describe('password-reset.vue', () => {
const data = PasswordReset.data ? PasswordReset.data() : {}
const aData = await PasswordReset.asyncData({
store,
redirect
redirect,
})
PasswordReset.data = function() {
return { ...data, ...aData};
};
PasswordReset.data = function () {
return { ...data, ...aData }
}
}
return mount(PasswordReset, {
mocks,

View File

@ -29,10 +29,8 @@ describe('post/_id.vue', () => {
defaultClient: {
query: jest.fn().mockResolvedValue({
data: {
Post: [
{ author: { id: authorId } }
]
}
Post: [{ author: { id: authorId } }],
},
}),
},
},
@ -52,9 +50,9 @@ describe('post/_id.vue', () => {
error,
params: { id: '123' },
})
_id.data = function() {
return { ...data, ...aData};
};
_id.data = function () {
return { ...data, ...aData }
}
}
return mount(_id, { store, mocks, localVue })
}
@ -70,7 +68,7 @@ describe('post/_id.vue', () => {
authorId = 'some-author'
userId = 'some-user'
wrapper = await Wrapper()
expect(error).toBeCalledWith({"message": "error-pages.cannot-edit-post", "statusCode": 403})
expect(error).toBeCalledWith({ message: 'error-pages.cannot-edit-post', statusCode: 403 })
})
it('renders with asyncData of same user', async () => {