Commit ad3cf5ad authored by Martin Wortschack's avatar Martin Wortschack

Merge branch '216792-fix-roadmap-buffered-rendering' into 'master'

Fix Roadmap buffered rendering

See merge request gitlab-org/gitlab!40243
parents 474fe142 e454f82b
...@@ -95,7 +95,7 @@ export default { ...@@ -95,7 +95,7 @@ export default {
methods: { methods: {
...mapActions(['setBufferSize', 'toggleEpic']), ...mapActions(['setBufferSize', 'toggleEpic']),
initMounted() { initMounted() {
this.roadmapShellEl = this.$root.$el && this.$root.$el.firstChild; this.roadmapShellEl = this.$root.$el && this.$root.$el.querySelector('.js-roadmap-shell');
this.setBufferSize(Math.ceil((window.innerHeight - this.$el.offsetTop) / EPIC_ITEM_HEIGHT)); this.setBufferSize(Math.ceil((window.innerHeight - this.$el.offsetTop) / EPIC_ITEM_HEIGHT));
// Wait for component render to complete // Wait for component render to complete
......
...@@ -91,7 +91,11 @@ export default { ...@@ -91,7 +91,11 @@ export default {
</script> </script>
<template> <template>
<div class="roadmap-shell" data-qa-selector="roadmap_shell" @scroll="handleScroll"> <div
class="roadmap-shell js-roadmap-shell"
data-qa-selector="roadmap_shell"
@scroll="handleScroll"
>
<roadmap-timeline-section <roadmap-timeline-section
ref="roadmapTimeline" ref="roadmapTimeline"
:preset-type="presetType" :preset-type="presetType"
......
...@@ -161,10 +161,6 @@ describe('EpicsListSectionComponent', () => { ...@@ -161,10 +161,6 @@ describe('EpicsListSectionComponent', () => {
jest.spyOn(wrapper.vm, 'scrollToTodayIndicator').mockImplementation(() => {}); jest.spyOn(wrapper.vm, 'scrollToTodayIndicator').mockImplementation(() => {});
}); });
it('sets value of `roadmapShellEl` with root component element', () => {
expect(wrapper.vm.roadmapShellEl instanceof HTMLElement).toBe(true);
});
it('calls action `setBufferSize` with value based on window.innerHeight and component element position', () => { it('calls action `setBufferSize` with value based on window.innerHeight and component element position', () => {
expect(wrapper.vm.bufferSize).toBe(16); expect(wrapper.vm.bufferSize).toBe(16);
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment