Commit e454f82b authored by Kushal Pandya's avatar Kushal Pandya

Fix roadmap shell element query selector

Fixes roadmap shell element selector which is used by
VirtualList component.
parent da87fda6
......@@ -95,7 +95,7 @@ export default {
methods: {
...mapActions(['setBufferSize', 'toggleEpic']),
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));
// Wait for component render to complete
......
......@@ -91,7 +91,11 @@ export default {
</script>
<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
ref="roadmapTimeline"
:preset-type="presetType"
......
......@@ -161,10 +161,6 @@ describe('EpicsListSectionComponent', () => {
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', () => {
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