Commit ec969158 authored by Alexander Turinske's avatar Alexander Turinske

Update CSS selector for sticky section

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