Skip to content

Commit 174615d

Browse files
committed
fix qunit tests
1 parent 6e3087c commit 174615d

3 files changed

Lines changed: 10 additions & 12 deletions

File tree

packages/devextreme/js/__internal/scheduler/tooltip_strategies/m_tooltip_strategy_base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export class TooltipStrategyBase {
115115

116116
isShownForTarget(target: dxElementWrapper): boolean {
117117
if (this.tooltip?.option('visible')) {
118-
return this.tooltip?.option('target')?.get(0) === target.get(0);
118+
return this.tooltip?.option('target')[0] === target[0];
119119
}
120120

121121
return false;

packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/desktopTooltip.tests.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,9 @@ QUnit.test('contentTemplate passed to createComponent should work correct', asyn
116116

117117
assert.equal(stubCreateComponent.getCall(1).args[0][0].nodeName, 'DIV');
118118
assert.equal(stubCreateComponent.getCall(1).args[1], List);
119-
assert.equal(Object.keys(stubCreateComponent.getCall(1).args[2]).length, 7);
119+
assert.equal(Object.keys(stubCreateComponent.getCall(1).args[2]).length, 8);
120120
assert.equal(stubCreateComponent.getCall(1).args[2].dataSource, dataList);
121+
assert.equal(stubCreateComponent.getCall(1).args[2].repaintChangesOnly, true);
121122
assert.equal(stubCreateComponent.getCall(1).args[2].showScrollbar, 'onHover');
122123
assert.ok(stubCreateComponent.getCall(1).args[2].onContentReady);
123124
assert.ok(stubCreateComponent.getCall(1).args[2].onItemClick);
@@ -274,7 +275,6 @@ QUnit.test('itemTemplate passed to createComponent should work correct', async f
274275
stubComponent.option.reset();
275276
const e = { event: { stopPropagation: sinon.spy() } };
276277
stubCreateComponent.getCall(2).args[2].onClick(e);
277-
assert.deepEqual(stubComponent.option.getCall(0).args, ['visible', false], 'tooltip is hide');
278278
assert.ok(e.event.stopPropagation.called);
279279
assert.deepEqual(stubCheckAndDeleteAppointment.getCall(0).args, [item.appointment, item.targetedAppointment]);
280280
});
@@ -305,15 +305,15 @@ QUnit.test('Delete button shouldn\'t created, appointment is disabled', async fu
305305

306306
QUnit.test('isShownForTarget method, tooltip is not created', async function(assert) {
307307
const tooltip = this.createSimpleTooltip(this.tooltipOptions);
308-
const target = ['target'];
308+
const target = $('<div>');
309309

310310
assert.ok(!tooltip.isShownForTarget(target), 'tooltip is not created and haven\'t data');
311311
});
312312

313313
QUnit.test('isShownForTarget method, tooltip is created and shown', async function(assert) {
314314
const tooltip = this.createSimpleTooltip(this.tooltipOptions);
315315
const dataList = [{ data: 'data1' }, { data: 'data2' }];
316-
const target = ['target'];
316+
const target = $('<div>');
317317
const callback = sinon.stub();
318318

319319
callback.withArgs('target').returns(target);
@@ -324,13 +324,13 @@ QUnit.test('isShownForTarget method, tooltip is created and shown', async functi
324324
stubCreateComponent.getCall(0).args[2].contentTemplate('<div>');
325325

326326
assert.ok(tooltip.isShownForTarget(target), 'tooltip is shown and have the same target');
327-
assert.ok(!tooltip.isShownForTarget(['target_1']), 'tooltip is shown and have another target');
327+
assert.ok(!tooltip.isShownForTarget($('<div>')), 'tooltip is shown and have another target');
328328
});
329329

330330
QUnit.test('isShownForTarget method, tooltip is hide', async function(assert) {
331331
const tooltip = this.createSimpleTooltip(this.tooltipOptions);
332332
const dataList = [{ data: 'data1' }, { data: 'data2' }];
333-
const target = ['target'];
333+
const target = $('<div>');
334334
const callback = sinon.stub();
335335

336336
callback.withArgs('target').returns(target);

packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.adaptivity.tests.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ import {
55
initTestMarkup,
66
isDesktopEnvironment,
77
TOOLBAR_TOP_LOCATION,
8-
TOOLBAR_BOTTOM_LOCATION } from '../../helpers/scheduler/helpers.js';
8+
} from '../../helpers/scheduler/helpers.js';
99
import { getSimpleDataArray } from '../../helpers/scheduler/data.js';
10-
import { waitAsync } from '../../helpers/scheduler/waitForAsync.js';
1110
import resizeCallbacks from 'core/utils/resize_callbacks';
1211
import devices from '__internal/core/m_devices';
1312
import 'ui/switch';
@@ -86,7 +85,7 @@ module('Mobile tooltip', moduleConfig, () => {
8685
clock.restore();
8786
});
8887

89-
test('Tooltip should hide after execute actions', async function(assert) {
88+
test('Tooltip visibility after actions', async function(assert) {
9089
const scheduler = await createInstance();
9190
const initialDataCount = scheduler.instance.option('dataSource').length;
9291

@@ -105,7 +104,7 @@ module('Mobile tooltip', moduleConfig, () => {
105104
assert.ok(scheduler.tooltip.isVisible(), 'Tooltip should be visible after click on appointment');
106105

107106
scheduler.tooltip.clickOnDeleteButton();
108-
assert.notOk(scheduler.tooltip.isVisible(), 'Tooltip should be hide after click on remove button in tooltip');
107+
assert.ok(scheduler.tooltip.isVisible(), 'Tooltip should be visible after click on remove button in tooltip');
109108

110109
assert.equal(scheduler.instance.option('dataSource').length, initialDataCount - 1, 'Appointment should delete form dataSource after click on delete button in tooltip');
111110
});
@@ -244,7 +243,6 @@ if(!isDesktopEnvironment()) {
244243

245244
module('Appointment popup buttons', moduleConfig, () => {
246245
const SECTION_AFTER = 'after';
247-
const SECTION_BEFORE = 'before';
248246
const DONE_BUTTON = 'done';
249247
const CANCEL_BUTTON = 'cancel';
250248

0 commit comments

Comments
 (0)