Add feature image grid
This commit is contained in:
@ -1,12 +0,0 @@
|
||||
import { shallowMount } from '@vue/test-utils'
|
||||
import HelloWorld from '@/components/HelloWorld.vue'
|
||||
|
||||
describe('HelloWorld.vue', () => {
|
||||
it('renders props.msg when passed', () => {
|
||||
const msg = 'new message'
|
||||
const wrapper = shallowMount(HelloWorld, {
|
||||
propsData: { msg }
|
||||
})
|
||||
expect(wrapper.text()).toMatch(msg)
|
||||
})
|
||||
})
|
12
tests/unit/image_grid.spec.js
Normal file
12
tests/unit/image_grid.spec.js
Normal file
@ -0,0 +1,12 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import ImageGrid from '@/components/ImageGrid.vue'
|
||||
|
||||
describe('ImageGrid.vue', () => {
|
||||
it('toggles loading', () => {
|
||||
const wrapper = mount(ImageGrid)
|
||||
expect(wrapper.vm.loading).toBe(true)
|
||||
expect(wrapper.text()).toContain('Loading...')
|
||||
wrapper.setData({ loading: false })
|
||||
expect(wrapper.vm.loading).toBe(false)
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user