Skip to content

Commit 6949ad4

Browse files
author
Julia Volkova
committed
added font-family to overlays for popup and floating button
1 parent 0961adf commit 6949ad4

2 files changed

Lines changed: 96 additions & 87 deletions

File tree

e2e/testcafe-devextreme/tests/editors/button/floatingAction.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable no-restricted-syntax */
22
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
33
import { ClientFunction, Selector } from 'testcafe';
4-
import { getThemePostfix, testScreenshot } from '../../../helpers/themeUtils';
4+
import { getThemePostfix, isMaterial, testScreenshot } from '../../../helpers/themeUtils';
55
import url from '../../../helpers/getPageUrl';
66
import { createWidget } from '../../../helpers/createWidget';
77
import { appendElementTo, setStyleAttribute } from '../../../helpers/domUtils';
@@ -77,7 +77,10 @@ for (const label of ['Add Row', '']) {
7777
.expect(compareResults.isValid())
7878
.ok(compareResults.errorMessages());
7979
}).before(async () => {
80-
await setStyleAttribute(Selector('#container'), 'width: 300px; height: 300px; font-family: sans-serif !important;');
80+
await setStyleAttribute(Selector('#container'), 'width: 300px; height: 300px;');
81+
if (isMaterial()) {
82+
await setStyleAttribute(Selector('.dx-overlay-wrapper'), 'font-family: sans-serif !important;');
83+
}
8184
await appendElementTo('#container', 'div', 'speed-dial-action');
8285

8386
await setGlobalConfig();

e2e/testcafe-devextreme/tests/editors/overlays/toolbarIntegration.ts

Lines changed: 91 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ import Popup from 'devextreme-testcafe-models/popup';
33
import Popover from 'devextreme-testcafe-models/popover';
44
import Toolbar from 'devextreme-testcafe-models/toolbar/toolbar';
55
import { Selector } from 'testcafe';
6-
import { testScreenshot } from '../../../helpers/themeUtils';
6+
import { isMaterial, testScreenshot } from '../../../helpers/themeUtils';
77
import url from '../../../helpers/getPageUrl';
88
import { createWidget } from '../../../helpers/createWidget';
99
import { safeSizeTest } from '../../../helpers/safeSizeTest';
10+
import { insertStylesheetRulesToPage, setStyleAttribute } from '../../../helpers/domUtils';
1011

1112
fixture`Popup_toolbar`
1213
.page(url(__dirname, '../../container.html'));
@@ -40,90 +41,95 @@ const ANIMATION_DELAY = 500;
4041
await t
4142
.expect(compareResults.isValid())
4243
.ok(compareResults.errorMessages());
43-
}, [600, 400]).before(async () => createWidget(name as 'dxPopup' | 'dxPopover', {
44-
showCloseButton: true,
45-
// eslint-disable-next-line no-multi-str
46-
contentTemplate: () => $('<div>').text('\
47-
Lorem Ipsum is simply dummy text of the printing and typesetting industry.\
48-
Lorem Ipsum has been the industrys standard dummy text ever since the 1500s,\
49-
when an unknown printer took a galley of type and scrambled it to make a type specimen book.\
50-
'),
51-
width: '60%',
52-
height: 300,
53-
showTitle: true,
54-
rtlEnabled,
55-
visible: true,
56-
animation: undefined,
57-
target: COMPONENT_SELECTOR,
58-
hideOnOutsideClick: true,
59-
toolbarItems: [{
60-
location: 'before',
61-
widget: 'dxButton',
62-
options: {
63-
icon: 'back',
64-
},
65-
toolbar,
66-
}, {
67-
location: 'before',
68-
widget: 'dxButton',
69-
locateInMenu: 'auto',
70-
options: {
71-
icon: 'refresh',
72-
},
73-
toolbar,
74-
}, {
75-
location: 'center',
76-
locateInMenu: 'never',
77-
template() {
78-
return $('<div><b>Popup\'s</b> title</div>');
79-
},
80-
toolbar,
81-
}, {
82-
location: 'after',
83-
widget: 'dxSelectBox',
84-
locateInMenu: 'auto',
85-
options: {
86-
width: 140,
87-
items: [1, 2, 3, 4, 5],
88-
value: 3,
89-
},
90-
toolbar,
91-
}, {
92-
location: 'after',
93-
widget: 'dxButton',
94-
locateInMenu: 'auto',
95-
options: {
96-
icon: 'plus',
97-
},
98-
toolbar,
99-
}, {
100-
locateInMenu: 'always',
101-
widget: 'dxButton',
102-
options: {
103-
icon: 'save',
104-
text: 'Save',
105-
},
106-
toolbar,
107-
}, {
108-
widget: 'dxButton',
109-
toolbar: toolbar === 'top'
110-
? 'bottom'
111-
: 'top',
112-
location: 'before',
113-
options: {
114-
icon: 'email',
115-
},
116-
}, {
117-
widget: 'dxButton',
118-
toolbar: toolbar === 'top'
119-
? 'bottom'
120-
: 'top',
121-
location: 'after',
122-
options: {
123-
text: 'Close',
124-
},
125-
}],
126-
}));
44+
}, [600, 400]).before(async () => {
45+
if (isMaterial()) {
46+
await setStyleAttribute(Selector('.dx-overlay-wrapper'), 'font-family: sans-serif !important;');
47+
}
48+
return createWidget(name as 'dxPopup' | 'dxPopover', {
49+
showCloseButton: true,
50+
// eslint-disable-next-line no-multi-str
51+
contentTemplate: () => $('<div>').text('\
52+
Lorem Ipsum is simply dummy text of the printing and typesetting industry.\
53+
Lorem Ipsum has been the industrys standard dummy text ever since the 1500s,\
54+
when an unknown printer took a galley of type and scrambled it to make a type specimen book.\
55+
'),
56+
width: '60%',
57+
height: 300,
58+
showTitle: true,
59+
rtlEnabled,
60+
visible: true,
61+
animation: undefined,
62+
target: COMPONENT_SELECTOR,
63+
hideOnOutsideClick: true,
64+
toolbarItems: [{
65+
location: 'before',
66+
widget: 'dxButton',
67+
options: {
68+
icon: 'back',
69+
},
70+
toolbar,
71+
}, {
72+
location: 'before',
73+
widget: 'dxButton',
74+
locateInMenu: 'auto',
75+
options: {
76+
icon: 'refresh',
77+
},
78+
toolbar,
79+
}, {
80+
location: 'center',
81+
locateInMenu: 'never',
82+
template() {
83+
return $('<div><b>Popup\'s</b> title</div>');
84+
},
85+
toolbar,
86+
}, {
87+
location: 'after',
88+
widget: 'dxSelectBox',
89+
locateInMenu: 'auto',
90+
options: {
91+
width: 140,
92+
items: [1, 2, 3, 4, 5],
93+
value: 3,
94+
},
95+
toolbar,
96+
}, {
97+
location: 'after',
98+
widget: 'dxButton',
99+
locateInMenu: 'auto',
100+
options: {
101+
icon: 'plus',
102+
},
103+
toolbar,
104+
}, {
105+
locateInMenu: 'always',
106+
widget: 'dxButton',
107+
options: {
108+
icon: 'save',
109+
text: 'Save',
110+
},
111+
toolbar,
112+
}, {
113+
widget: 'dxButton',
114+
toolbar: toolbar === 'top'
115+
? 'bottom'
116+
: 'top',
117+
location: 'before',
118+
options: {
119+
icon: 'email',
120+
},
121+
}, {
122+
widget: 'dxButton',
123+
toolbar: toolbar === 'top'
124+
? 'bottom'
125+
: 'top',
126+
location: 'after',
127+
options: {
128+
text: 'Close',
129+
},
130+
}],
131+
})
132+
});
127133
});
128134
});
129135
});

0 commit comments

Comments
 (0)