Skip to content

Commit

Permalink
FileManager - Fix IE tests (#12790)
Browse files Browse the repository at this point in the history
* FileManager - Fix IE tests

* fix test
  • Loading branch information
vladkovl committed Apr 20, 2020
1 parent 10ae193 commit 216108e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
6 changes: 3 additions & 3 deletions testing/helpers/fileManagerHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -692,10 +692,10 @@ export const createTestFileSystem = () => {

export const createHugeFileSystem = () => {
const result = [];
for(let i = 0; i < 50; i++) {
for(let i = 0; i < 10; i++) {
result.push({
name: `Folder ${i}`,
isDirectory: true
name: `File ${i}.txt`,
isDirectory: false
});
}
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -662,14 +662,16 @@ QUnit.module('Navigation operations', moduleConfig, () => {

test('Details view - must keep scroll position', function(assert) {
this.fileManager.option({
width: 500,
height: 250,
fileSystemProvider: createHugeFileSystem(),
itemView: {
mode: 'details'
}
});
this.clock.tick(400);

const scrollPosition = 150;
const scrollPosition = 100;
this.wrapper.getDetailsViewScrollableContainer().scrollTop(scrollPosition);
this.clock.tick(400);

Expand All @@ -680,7 +682,14 @@ QUnit.module('Navigation operations', moduleConfig, () => {
});

test('Thumbnails view - must keep scroll position', function(assert) {
this.fileManager.option('fileSystemProvider', createHugeFileSystem());
const originalFunc = renderer.fn.width;
renderer.fn.width = () => 1200;

this.fileManager.option({
width: 500,
height: 250,
fileSystemProvider: createHugeFileSystem()
});
this.clock.tick(400);

const scrollPosition = 150;
Expand All @@ -691,6 +700,8 @@ QUnit.module('Navigation operations', moduleConfig, () => {
this.clock.tick(800);

assert.strictEqual(this.wrapper.getThumbnailsViewScrollableContainer().scrollTop(), scrollPosition, 'scroll position is the same');

renderer.fn.width = originalFunc;
});

test('All views - must keep scroll position for sync focused item', function(assert) {
Expand Down

0 comments on commit 216108e

Please sign in to comment.