lint: clean

This commit is contained in:
ogerly 2020-04-22 19:03:45 +02:00
parent cccb6cec83
commit 404b926a1f
2 changed files with 13 additions and 35 deletions

View File

@ -6,15 +6,12 @@ import helpers from '~/storybook/helpers'
helpers.init() helpers.init()
const localVue = global.localVue const localVue = global.localVue
localVue.directive('scrollTo', jest.fn()) localVue.directive('scrollTo', jest.fn())
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>'
describe('SearchResults', () => { describe('SearchResults', () => {
let mocks, getters, propsData, wrapper let mocks, getters, propsData, wrapper
const Wrapper = () => { const Wrapper = () => {
@ -50,20 +47,13 @@ describe('SearchResults', () => {
}) })
}) })
describe('contains users less as 25 results', () => { describe('contains users less as 25 results', () => {
beforeEach(() => { beforeEach(() => {
wrapper.setData({ users: helpers.fakeUser(1), userCount: 1, activeTab: 'User' }) wrapper.setData({ users: helpers.fakeUser(1), userCount: 1, activeTab: 'User' })
}) })
it('renders pagination', () => {
expect(wrapper.find('.pagination-buttons').exists()).toBe(true)
})
it('show NOT pagination', () => { it('show NOT pagination', () => {
expect(wrapper.find('.pagination-buttons').attributes().style).toBe('display: none;') expect(wrapper.find('.pagination-buttons').attributes().style).toBe('display: none;')
}) })
describe('contains users more as 25 results', () => { describe('contains users more as 25 results', () => {
@ -71,27 +61,16 @@ describe('SearchResults', () => {
wrapper.setData({ users: helpers.fakeUser(52), userCount: 52, activeTab: 'User' }) wrapper.setData({ users: helpers.fakeUser(52), userCount: 52, activeTab: 'User' })
}) })
it('show pagination', () => {
expect(wrapper.find('.pagination-buttons').attributes().style).toBe('')
})
it('renders user-list pagination', () => { it('renders user-list pagination', () => {
expect(wrapper.find('.user-list').exists()).toBe(true) expect(wrapper.find('.user-list').exists()).toBe(true)
}) })
it('renders pagination', () => {
expect(wrapper.find('.pagination-buttons').exists()).toBe(true)
})
it('show pagination', () => {
expect(wrapper.find('.pagination-buttons').attributes().style).toBe('')
}) })
}) })
})
/* /*
describe('contains posts', () => { describe('contains posts', () => {
beforeEach(() => { beforeEach(() => {
@ -117,7 +96,6 @@ describe('SearchResults', () => {
}) })
}) })
*/ */
}) })
}) })
}) })

View File

@ -199,7 +199,7 @@ export default {
}, },
searchCount() { searchCount() {
return this.postCount + this.userCount + this.hashtagCount return this.postCount + this.userCount + this.hashtagCount
} },
}, },
methods: { methods: {
clearPage() { clearPage() {