Commit ec969158 authored by Alexander Turinske's avatar Alexander Turinske

Update CSS selector for sticky section

parent ad2656fc
...@@ -20,7 +20,11 @@ export default { ...@@ -20,7 +20,11 @@ export default {
<slot name="header"></slot> <slot name="header"></slot>
</header> </header>
<section v-if="hasStickySlot" class="position-sticky gl-z-index-2 security_dashboard_filters"> <section
v-if="hasStickySlot"
data-testid="sticky-section"
class="position-sticky gl-z-index-2 security_dashboard_filters"
>
<slot name="sticky"></slot> <slot name="sticky"></slot>
</section> </section>
......
...@@ -4,6 +4,7 @@ import SecurityDashboardLayout from 'ee/security_dashboard/components/security_d ...@@ -4,6 +4,7 @@ import SecurityDashboardLayout from 'ee/security_dashboard/components/security_d
describe('Security Dashboard Layout component', () => { describe('Security Dashboard Layout component', () => {
let wrapper; let wrapper;
const SMALLER_SECTION_CLASS = 'col-xl-7'; const SMALLER_SECTION_CLASS = 'col-xl-7';
const STICKY_SECTION_SELECTOR = '[data-testid="sticky-section"]';
const DummyComponent = { const DummyComponent = {
name: 'dummy-component', name: 'dummy-component',
...@@ -17,7 +18,7 @@ describe('Security Dashboard Layout component', () => { ...@@ -17,7 +18,7 @@ describe('Security Dashboard Layout component', () => {
const findArticle = () => wrapper.find('article'); const findArticle = () => wrapper.find('article');
const findHeader = () => wrapper.find('header'); const findHeader = () => wrapper.find('header');
const findAside = () => wrapper.find('aside'); const findAside = () => wrapper.find('aside');
const findStickySection = () => wrapper.find('section'); const findStickySection = () => wrapper.find(STICKY_SECTION_SELECTOR);
afterEach(() => { afterEach(() => {
wrapper.destroy(); wrapper.destroy();
...@@ -35,7 +36,7 @@ describe('Security Dashboard Layout component', () => { ...@@ -35,7 +36,7 @@ describe('Security Dashboard Layout component', () => {
${'article'} | ${true} ${'article'} | ${true}
${'header'} | ${false} ${'header'} | ${false}
${'aside'} | ${false} ${'aside'} | ${false}
${'section section'} | ${false} ${STICKY_SECTION_SELECTOR} | ${false}
`('should find that $element exists is $exists', ({ element, exists }) => { `('should find that $element exists is $exists', ({ element, exists }) => {
expect(wrapper.find(element).exists()).toBe(exists); expect(wrapper.find(element).exists()).toBe(exists);
}); });
...@@ -66,7 +67,7 @@ describe('Security Dashboard Layout component', () => { ...@@ -66,7 +67,7 @@ describe('Security Dashboard Layout component', () => {
${'article'} | ${true} ${'article'} | ${true}
${'header'} | ${true} ${'header'} | ${true}
${'aside'} | ${false} ${'aside'} | ${false}
${'section section'} | ${false} ${STICKY_SECTION_SELECTOR} | ${false}
`('should find that $element exists is $exists', ({ element, exists }) => { `('should find that $element exists is $exists', ({ element, exists }) => {
expect(wrapper.find(element).exists()).toBe(exists); expect(wrapper.find(element).exists()).toBe(exists);
}); });
...@@ -96,7 +97,7 @@ describe('Security Dashboard Layout component', () => { ...@@ -96,7 +97,7 @@ describe('Security Dashboard Layout component', () => {
${'article'} | ${true} ${'article'} | ${true}
${'header'} | ${false} ${'header'} | ${false}
${'aside'} | ${false} ${'aside'} | ${false}
${'section section'} | ${true} ${STICKY_SECTION_SELECTOR} | ${true}
`('should find that $element exists is $exists', ({ element, exists }) => { `('should find that $element exists is $exists', ({ element, exists }) => {
expect(wrapper.find(element).exists()).toBe(exists); expect(wrapper.find(element).exists()).toBe(exists);
}); });
...@@ -127,7 +128,7 @@ describe('Security Dashboard Layout component', () => { ...@@ -127,7 +128,7 @@ describe('Security Dashboard Layout component', () => {
${'article'} | ${true} ${'article'} | ${true}
${'header'} | ${false} ${'header'} | ${false}
${'aside'} | ${true} ${'aside'} | ${true}
${'section section'} | ${false} ${STICKY_SECTION_SELECTOR} | ${false}
`('should find that $element exists is $exists', ({ element, exists }) => { `('should find that $element exists is $exists', ({ element, exists }) => {
expect(wrapper.find(element).exists()).toBe(exists); expect(wrapper.find(element).exists()).toBe(exists);
}); });
......
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