Skip to content

Commit e8e1da1

Browse files
authored
T1297188 - FileManager inside popup - W1025 (#30408)
1 parent a59666f commit e8e1da1

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';
@@ -31,17 +33,49 @@ const prepareFileManager = (context, isPure, options) => {
3133
context.clock.tick(400);
3234
};
3335

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

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

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

4273
const moduleConfig = {
4374

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

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

0 commit comments

Comments
 (0)