Skip to content

Commit 1ba4912

Browse files
authored
T1297188 - FileManager inside popup - W1025 (#30401)
1 parent dfc2763 commit 1ba4912

File tree

2 files changed

+62
-5
lines changed

2 files changed

+62
-5
lines changed

packages/devextreme/js/ui/file_manager/ui.file_manager.item_list.details.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ class FileManagerDetailsItemList extends FileManagerItemListBase {
9595
loadPanel: {
9696
shading: true
9797
},
98+
height: '100%',
9899
showColumnLines: false,
99100
showRowLines: false,
100101
columnHidingEnabled: false,

packages/devextreme/testing/tests/DevExpress.ui.widgets/fileManagerParts/markup.tests.js

Lines changed: 61 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
const { test } = QUnit;
22
import $ from 'jquery';
3+
import { extend } from 'core/utils/extend';
4+
import consoleUtils from '__internal/core/utils/m_console';
35
import 'ui/file_manager';
46
import fx from 'common/core/animation/fx';
57
import windowUtils from 'core/utils/window';
@@ -32,17 +34,49 @@ const prepareFileManager = (context, isPure, options) => {
3234
context.clock.tick(400);
3335
};
3436

37+
const moduleConfig_T1297188 = {
38+
beforeEach: function() {
39+
const markup = '<div id="fileManagerPopup"></div>';
40+
$('#qunit-fixture').html(markup);
3541

36-
QUnit.testStart(function() {
37-
const markup =
38-
'<div id="fileManager"></div>';
42+
this.clock = sinon.useFakeTimers();
43+
fx.off = true;
44+
this.clock.tick(400);
45+
},
46+
afterEach: function() {
47+
this.clock.tick(5000);
48+
this.clock.restore();
49+
fx.off = false;
50+
}
51+
};
3952

40-
$('#qunit-fixture').html(markup);
41-
});
53+
const createFileManagerInsidePopup = (context, useThumbnailViewMode, extOptions) => {
54+
const viewMode = useThumbnailViewMode ? 'thumbnails' : 'details';
55+
extOptions = extOptions || {};
56+
const options = extend({
57+
fileSystemProvider: createTestFileSystem(),
58+
itemView: {
59+
mode: viewMode
60+
}
61+
}, extOptions);
62+
const fileManagerPopup = $('#fileManagerPopup').dxPopup({
63+
visible: true,
64+
contentTemplate: function(contentElement) {
65+
$('<div id="fileManager"></div>')
66+
.appendTo(contentElement)
67+
.dxFileManager(options);
68+
}
69+
}).dxPopup('instance');
70+
context.clock.tick(400);
71+
return fileManagerPopup;
72+
};
4273

4374
const moduleConfig = {
4475

4576
beforeEach: function() {
77+
const markup = '<div id="fileManager"></div>';
78+
$('#qunit-fixture').html(markup);
79+
4680
this.clock = sinon.useFakeTimers();
4781
fx.off = true;
4882
},
@@ -207,3 +241,25 @@ QUnit.module('Markup rendering', moduleConfig, () => {
207241
});
208242

209243
});
244+
245+
QUnit.module('fileManager inside popup not causing any warnings in console (T1297188)', moduleConfig_T1297188, () => {
246+
test('no console warnings displayed (T1297188)', function(assert) {
247+
const loggerSpy = sinon.spy(consoleUtils.logger, 'warn');
248+
249+
try {
250+
createFileManagerInsidePopup(this, false, { width: '100%', height: '100%' });
251+
252+
this.clock.tick(400);
253+
254+
const w1025Warning = loggerSpy.args.find(([warning, ...rest]) =>
255+
typeof warning === 'string' && warning.includes('W1025')
256+
);
257+
258+
assert.ok(!w1025Warning, 'W1025 scrolling.mode warning should not appear in console');
259+
260+
} finally {
261+
loggerSpy.restore();
262+
}
263+
});
264+
});
265+

0 commit comments

Comments
 (0)