diff --git a/webapp/components/FilterMenu/FilterMenu.vue b/webapp/components/FilterMenu/FilterMenu.vue index c306588c7..e4c689263 100644 --- a/webapp/components/FilterMenu/FilterMenu.vue +++ b/webapp/components/FilterMenu/FilterMenu.vue @@ -1,27 +1,24 @@ @@ -43,6 +40,11 @@ export default { background-color: $background-color-soft; } +.filter-menu-content { + height: 100%; + align-items: center; +} + .filter-menu-title { display: flex; align-items: center; diff --git a/webapp/components/MasonryGrid/MasonryGrid.spec.js b/webapp/components/MasonryGrid/MasonryGrid.spec.js new file mode 100644 index 000000000..8cedac652 --- /dev/null +++ b/webapp/components/MasonryGrid/MasonryGrid.spec.js @@ -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') + }) +}) diff --git a/webapp/components/MasonryGrid/MasonryGrid.vue b/webapp/components/MasonryGrid/MasonryGrid.vue new file mode 100644 index 000000000..c27f134e8 --- /dev/null +++ b/webapp/components/MasonryGrid/MasonryGrid.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/webapp/components/MasonryGrid/MasonryGridItem.spec.js b/webapp/components/MasonryGrid/MasonryGridItem.spec.js new file mode 100644 index 000000000..ba22380ae --- /dev/null +++ b/webapp/components/MasonryGrid/MasonryGridItem.spec.js @@ -0,0 +1,27 @@ +import { shallowMount } from '@vue/test-utils' +import MasonryGridItem from './MasonryGridItem' + +describe('MasonryGridItem', () => { + let wrapper + + beforeEach(() => { + wrapper = shallowMount(MasonryGridItem) + wrapper.vm.$parent.$emit = jest.fn() + }) + + it('emits "calculating-item-height" when starting calculation', async () => { + wrapper.vm.calculateItemHeight() + await wrapper.vm.$nextTick() + + const firstCallArgument = wrapper.vm.$parent.$emit.mock.calls[0][0] + expect(firstCallArgument).toBe('calculating-item-height') + }) + + it('emits "finished-calculating-item-height" after the calculation', async () => { + wrapper.vm.calculateItemHeight() + await wrapper.vm.$nextTick() + + const secondCallArgument = wrapper.vm.$parent.$emit.mock.calls[1][0] + expect(secondCallArgument).toBe('finished-calculating-item-height') + }) +}) diff --git a/webapp/components/MasonryGrid/MasonryGridItem.vue b/webapp/components/MasonryGrid/MasonryGridItem.vue new file mode 100644 index 000000000..9ac544b8c --- /dev/null +++ b/webapp/components/MasonryGrid/MasonryGridItem.vue @@ -0,0 +1,39 @@ + + + diff --git a/webapp/components/PostCard/index.vue b/webapp/components/PostCard/index.vue index 2ec8cf606..c0cc1a9a6 100644 --- a/webapp/components/PostCard/index.vue +++ b/webapp/components/PostCard/index.vue @@ -1,69 +1,71 @@ diff --git a/webapp/pages/profile/_id/_slug.vue b/webapp/pages/profile/_id/_slug.vue index 0be23371b..bc712e6e0 100644 --- a/webapp/pages/profile/_id/_slug.vue +++ b/webapp/pages/profile/_id/_slug.vue @@ -153,8 +153,8 @@ - - + + - + - + - +