Skip to content
Open
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,30 +1,23 @@
import FilterBuilder from 'devextreme-testcafe-models/filterBuilder';
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
import url from '../../../helpers/getPageUrl';
import { fields, filter } from './data';
import { safeSizeTest } from '../../../helpers/safeSizeTest';
import { createWidget } from '../../../helpers/createWidget';
import { testScreenshot } from '../../../helpers/themeUtils';
import { insertStylesheetRulesToPage } from '../../../helpers/domUtils';

fixture.disablePageReloads`Filter Builder Scrolling Test`
.page(url(__dirname, '../../container.html'));

// T1273328
safeSizeTest('FilterBuilder - The field drop-down window moves with the page scroll', async (t) => {
// T1273328 > T1294239
test('FilterBuilder - The field drop-down closes with the page scroll', async (t) => {
const filterBuilder = new FilterBuilder('#container');
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);

await filterBuilder.isReady();

await t
.click(filterBuilder.getItem('operation'))
.scrollIntoView(filterBuilder.getItem('operation', 4));

await testScreenshot(t, takeScreenshot, 'filterBuilder_scroll_with_popup.png', { element: filterBuilder.element });
await t
.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
await t.expect(FilterBuilder.getPopupTreeView().exists).notOk();
}).before(async () => {
await insertStylesheetRulesToPage('#container {height: 150px; overflow: scroll;}');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ $filterbuilder-menu-icon-color: null !default;
@use "./common";

.dx-filterbuilder {
position: relative;
background-color: $filterbuilder-bg;

@mixin button-color($color, $hover-color, $focus-color) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,8 @@ class FilterBuilder extends Widget<any> {
visible: true,
focusStateEnabled: false,
preventScrollEvents: false,
container: $popup,
hideOnParentScroll: this.option('closePopupOnTargetScroll'),
_hideOnParentScrollTarget: $popup,
hideOnOutsideClick: true,
onShown: options.popup.onShown,
shading: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1298,8 +1298,9 @@ QUnit.module('on value changed', function() {
});

// T824147
// T1273328 - new
QUnit.test('Add-condition popup should not be closed on scroll', function(assert) {
// T1273328
// T1294239 - new
QUnit.test('Add-condition popup should be closed on scroll by default', function(assert) {
// arrange
const container = $('#container');
const value = [['CompanyName', 'K&S Music']];
Expand All @@ -1315,7 +1316,7 @@ QUnit.module('on value changed', function() {
const popupInstance = container.children('.dx-filterbuilder-overlay').dxPopup('instance');

// assert
assert.equal(popupInstance.option('hideOnParentScroll'), false, 'popup\'s hideOnParentScroll');
assert.equal(popupInstance.option('hideOnParentScroll'), true, 'popup\'s hideOnParentScroll should be true by default');
});

// T804262
Expand Down Expand Up @@ -1611,7 +1612,7 @@ QUnit.module('Group operations', function() {

$('.' + FILTER_BUILDER_IMAGE_ADD_CLASS).trigger('dxclick');
let popup = container.find(`.${FILTER_BUILDER_OVERLAY_CLASS}`);
assert.equal(popup.length, 2);
assert.ok(popup.length > 0);

selectMenuItem(1);

Expand Down
Loading