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 const localVue = global.localVue
config.stubs['nuxt'] = '<span><slot /></span>' config.stubs.nuxt = '<span><slot /></span>'
describe('basic.vue', () => { describe('basic.vue', () => {
let wrapper let wrapper

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -29,10 +29,8 @@ describe('post/_id.vue', () => {
defaultClient: { defaultClient: {
query: jest.fn().mockResolvedValue({ query: jest.fn().mockResolvedValue({
data: { data: {
Post: [ Post: [{ author: { id: authorId } }],
{ author: { id: authorId } } },
]
}
}), }),
}, },
}, },
@ -53,8 +51,8 @@ describe('post/_id.vue', () => {
params: { id: '123' }, params: { id: '123' },
}) })
_id.data = function () { _id.data = function () {
return { ...data, ...aData}; return { ...data, ...aData }
}; }
} }
return mount(_id, { store, mocks, localVue }) return mount(_id, { store, mocks, localVue })
} }
@ -70,7 +68,7 @@ describe('post/_id.vue', () => {
authorId = 'some-author' authorId = 'some-author'
userId = 'some-user' userId = 'some-user'
wrapper = await Wrapper() 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 () => { it('renders with asyncData of same user', async () => {