Skip to content

Commit 5edc542

Browse files
fix: verify deprecation warning for old API
1 parent 7d6be02 commit 5edc542

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,16 @@ module('ScrollTo', {
106106
scheduler.instance.scrollTo(new Date(2020, 8, 5));
107107
await waitAsync(0);
108108

109-
assert.equal(errors.log.callCount, 1, 'warning has been called once');
110-
assert.equal(errors.log.getCall(0).args[0], 'W1008', 'warning has correct error id');
109+
assert.equal(errors.log.callCount, 2, 'warnings have been called twice');
110+
assert.equal(errors.log.getCall(0).args[0], 'W0002', 'first warning is deprecation warning');
111+
assert.equal(errors.log.getCall(1).args[0], 'W1008', 'second warning has correct error id');
111112

112113
scheduler.instance.scrollTo(new Date(2020, 8, 14));
113114
await waitAsync(0);
114115

115-
assert.equal(errors.log.callCount, 2, 'warning has been called once');
116-
assert.equal(errors.log.getCall(1).args[0], 'W1008', 'warning has correct error id');
116+
assert.equal(errors.log.callCount, 4, 'warnings have been called four times total');
117+
assert.equal(errors.log.getCall(2).args[0], 'W0002', 'third warning is deprecation warning');
118+
assert.equal(errors.log.getCall(3).args[0], 'W1008', 'fourth warning has correct error id');
117119
});
118120

119121
test(`A warning should not be thrown when scrolling to a valid date when ${scrolling.text} is used`, async function(assert) {
@@ -122,7 +124,8 @@ module('ScrollTo', {
122124
scheduler.instance.scrollTo(new Date(2020, 8, 7));
123125
await waitAsync(0);
124126

125-
assert.equal(errors.log.callCount, 0, 'warning has been called once');
127+
assert.equal(errors.log.callCount, 1, 'deprecation warning has been called once');
128+
assert.equal(errors.log.getCall(0).args[0], 'W0002', 'warning is deprecation warning for old API');
126129
});
127130

128131
[{

0 commit comments

Comments
 (0)