Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileManager - Fix IE tests #12790

Merged
merged 2 commits into from
Apr 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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