Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/lib/utils/dom_utils_spec.js')
-rw-r--r--spec/frontend/lib/utils/dom_utils_spec.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/frontend/lib/utils/dom_utils_spec.js b/spec/frontend/lib/utils/dom_utils_spec.js
index b537e6b2bf8..d6bac935970 100644
--- a/spec/frontend/lib/utils/dom_utils_spec.js
+++ b/spec/frontend/lib/utils/dom_utils_spec.js
@@ -1,8 +1,10 @@
import { setHTMLFixture, resetHTMLFixture } from 'helpers/fixtures';
+
import {
addClassIfElementExists,
canScrollUp,
canScrollDown,
+ getContentWrapperHeight,
parseBooleanDataAttributes,
isElementVisible,
getParents,
@@ -235,4 +237,30 @@ describe('DOM Utils', () => {
expect(div.getAttribute('title')).toBe('another test');
});
});
+
+ describe('getContentWrapperHeight', () => {
+ const fixture = `
+ <div>
+ <div class="content-wrapper">
+ <div class="content"></div>
+ </div>
+ </div>
+ `;
+
+ beforeEach(() => {
+ setHTMLFixture(fixture);
+ });
+
+ afterEach(() => {
+ resetHTMLFixture();
+ });
+
+ it('returns the height of an element that exists', () => {
+ expect(getContentWrapperHeight('.content-wrapper')).toBe('0px');
+ });
+
+ it('returns an empty string for a class that does not exist', () => {
+ expect(getContentWrapperHeight('.does-not-exist')).toBe('');
+ });
+ });
});