mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
add tests for masonry grid
This commit is contained in:
parent
52c3a15be1
commit
5abf6003cc
23
webapp/components/MasonryGrid/MasonryGrid.spec.js
Normal file
23
webapp/components/MasonryGrid/MasonryGrid.spec.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import { shallowMount } from '@vue/test-utils'
|
||||||
|
import MasonryGrid from './MasonryGrid'
|
||||||
|
|
||||||
|
describe('MasonryGrid', () => {
|
||||||
|
let wrapper
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
wrapper = shallowMount(MasonryGrid)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('adds the "reset-grid-height" class when one or more children are updating', () => {
|
||||||
|
wrapper.trigger('calculating-item-height')
|
||||||
|
|
||||||
|
expect(wrapper.classes()).toContain('reset-grid-height')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('removes the "reset-grid-height" class when all children have completed updating', () => {
|
||||||
|
wrapper.setData({ itemsCalculating: 1 })
|
||||||
|
wrapper.trigger('finished-calculating-item-height')
|
||||||
|
|
||||||
|
expect(wrapper.classes()).not.toContain('reset-grid-height')
|
||||||
|
})
|
||||||
|
})
|
||||||
Loading…
x
Reference in New Issue
Block a user