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/ide/lib/editor_spec.js')
-rw-r--r--spec/frontend/ide/lib/editor_spec.js19
1 files changed, 9 insertions, 10 deletions
diff --git a/spec/frontend/ide/lib/editor_spec.js b/spec/frontend/ide/lib/editor_spec.js
index c21a7edb2da..cb2437b9db1 100644
--- a/spec/frontend/ide/lib/editor_spec.js
+++ b/spec/frontend/ide/lib/editor_spec.js
@@ -16,14 +16,6 @@ describe('Multi-file editor library', () => {
let holder;
let store;
- const setNodeOffsetWidth = (val) => {
- Object.defineProperty(instance.instance.getDomNode(), 'offsetWidth', {
- get() {
- return val;
- },
- });
- };
-
beforeEach(() => {
store = createStore();
el = document.createElement('div');
@@ -272,6 +264,13 @@ describe('Multi-file editor library', () => {
});
describe('updateDiffView', () => {
+ const setDiffNodeOffsetWidth = (val) => {
+ Object.defineProperty(instance.instance.getContainerDomNode(), 'offsetWidth', {
+ get() {
+ return val;
+ },
+ });
+ };
describe('edit mode', () => {
it('does not update options', () => {
instance.createInstance(holder);
@@ -292,7 +291,7 @@ describe('Multi-file editor library', () => {
});
it('sets renderSideBySide to false if el is less than 700 pixels', () => {
- setNodeOffsetWidth(600);
+ setDiffNodeOffsetWidth(600);
expect(instance.instance.updateOptions).not.toHaveBeenCalledWith({
renderSideBySide: false,
@@ -300,7 +299,7 @@ describe('Multi-file editor library', () => {
});
it('sets renderSideBySide to false if el is more than 700 pixels', () => {
- setNodeOffsetWidth(800);
+ setDiffNodeOffsetWidth(800);
expect(instance.instance.updateOptions).not.toHaveBeenCalledWith({
renderSideBySide: true,