Skip to content

Commit 065affc

Browse files
committed
update tests for new error calling
1 parent bd4eaa1 commit 065affc

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

packages/devextreme/testing/tests/DevExpress.core/utils.data.tests.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ QUnit.module('prototype pollution protection', {
496496
const obj = {};
497497
SETTER('__proto__.pp_dx')(obj, 'yes', { functionsAsIs: true });
498498

499-
assert.strictEqual(errors.log.calledWith('E0123', '__proto__'), true, 'should log E0123 for __proto__');
499+
assert.strictEqual(errors.log.calledWith('E0123', 'compileSetter', '__proto__'), true, 'should log E0123 for __proto__');
500500
assert.strictEqual(obj.pp_dx, undefined, 'target object must not be modified');
501501
assert.strictEqual(({}).pp_dx, undefined, 'Object.prototype must not be polluted');
502502
});
@@ -505,7 +505,7 @@ QUnit.module('prototype pollution protection', {
505505
const obj = {};
506506
SETTER('constructor.prototype.pp_dx')(obj, 'yes', { functionsAsIs: true });
507507

508-
assert.strictEqual(errors.log.calledWith('E0123', 'constructor'), true, 'should log E0123 for constructor');
508+
assert.strictEqual(errors.log.calledWith('E0123', 'compileSetter', 'constructor'), true, 'should log E0123 for constructor');
509509
assert.strictEqual(obj.pp_dx, undefined, 'target object must not be modified');
510510
assert.strictEqual(({}).pp_dx, undefined, 'Object.prototype must not be polluted');
511511
});
@@ -514,7 +514,7 @@ QUnit.module('prototype pollution protection', {
514514
const fn = function() {};
515515
SETTER('prototype.pp_dx')(fn, 'yes', { functionsAsIs: true });
516516

517-
assert.strictEqual(errors.log.calledWith('E0123', 'prototype'), true, 'should log E0123 for prototype');
517+
assert.strictEqual(errors.log.calledWith('E0123', 'compileSetter', 'prototype'), true, 'should log E0123 for prototype');
518518
assert.strictEqual(fn.pp_dx, undefined, 'function object must not be modified');
519519
assert.strictEqual(fn.prototype.pp_dx, undefined, 'function prototype must not be modified');
520520
});
@@ -531,45 +531,45 @@ QUnit.module('prototype pollution protection', {
531531
const obj = {};
532532
SETTER('a[constructor][prototype].pp_dx')(obj, 'yes', { functionsAsIs: true });
533533

534-
assert.strictEqual(errors.log.calledWith('E0123', 'constructor'), true, 'should log E0123 for constructor in bracket notation');
534+
assert.strictEqual(errors.log.calledWith('E0123', 'compileSetter', 'constructor'), true, 'should log E0123 for constructor in bracket notation');
535535
assert.strictEqual(({}).pp_dx, undefined, 'Object.prototype must not be polluted');
536536
});
537537

538538
test('compileSetter blocks unsafe fragment in non-first position (T1330839)', function(assert) {
539539
const obj = { a: { b: {} } };
540540
SETTER('a.b.__proto__')(obj, { pp_dx: 'yes' }, { functionsAsIs: true });
541541

542-
assert.strictEqual(errors.log.calledWith('E0123', '__proto__'), true, 'should log E0123 for __proto__ in non-first position');
542+
assert.strictEqual(errors.log.calledWith('E0123', 'compileSetter', '__proto__'), true, 'should log E0123 for __proto__ in non-first position');
543543
assert.strictEqual(obj.a.b.pp_dx, undefined, 'nested object must not inherit a polluted property');
544544
assert.strictEqual(({}).pp_dx, undefined, 'Object.prototype must not be polluted');
545545
});
546546

547547
test('compileGetter logs error and returns undefined for __proto__ path fragent (T1330839)', function(assert) {
548548
const result = GETTER('__proto__.pp_dx')({});
549549

550-
assert.strictEqual(errors.log.calledWith('E0123', '__proto__'), true, 'should log E0123 for __proto__');
550+
assert.strictEqual(errors.log.calledWith('E0123', 'compileGetter', '__proto__'), true, 'should log E0123 for __proto__');
551551
assert.strictEqual(result, undefined, 'getter must return undefined for __proto__');
552552
});
553553

554554
test('compileGetter logs error and returns undefined for constructor path fragment (T1330839)', function(assert) {
555555
const result = GETTER('constructor.prototype')(function() {});
556556

557-
assert.strictEqual(errors.log.calledWith('E0123', 'constructor'), true, 'should log E0123 for constructor');
557+
assert.strictEqual(errors.log.calledWith('E0123', 'compileGetter', 'constructor'), true, 'should log E0123 for constructor');
558558
assert.strictEqual(result, undefined, 'getter must return undefined for constructor');
559559
});
560560

561561
test('compileGetter logs error and returns undefined for prototype path fragment (T1330839)', function(assert) {
562562
const result = GETTER('prototype.pp_dx')(function() {});
563563

564-
assert.strictEqual(errors.log.calledWith('E0123', 'prototype'), true, 'should log E0123 for prototype');
564+
assert.strictEqual(errors.log.calledWith('E0123', 'compileGetter', 'prototype'), true, 'should log E0123 for prototype');
565565
assert.strictEqual(result, undefined, 'getter must return undefined for prototype');
566566
});
567567

568568
test('combineGetters logs error and skips __proto__ fragment, returns safe fields (T1330839)', function(assert) {
569569
const obj = { safe: 'value' };
570570
const result = GETTER(['__proto__.pp_dx', 'safe'])(obj);
571571

572-
assert.strictEqual(errors.log.calledWith('E0123', '__proto__'), true, 'should log E0123 for __proto__');
572+
assert.strictEqual(errors.log.calledWith('E0123', 'compileGetter', '__proto__'), true, 'should log E0123 for __proto__');
573573
assert.strictEqual(({}).pp_dx, undefined, 'Object.prototype must not be polluted');
574574
assert.deepEqual(result, { safe: 'value' }, 'safe field must still be returned');
575575
});
@@ -578,7 +578,7 @@ QUnit.module('prototype pollution protection', {
578578
const obj = { safe: 'value' };
579579
const result = GETTER(['constructor.prototype.pp_dx', 'safe'])(obj);
580580

581-
assert.strictEqual(errors.log.calledWith('E0123', 'constructor'), true, 'should log E0123 for constructor');
581+
assert.strictEqual(errors.log.calledWith('E0123', 'compileGetter', 'constructor'), true, 'should log E0123 for constructor');
582582
assert.strictEqual(({}).pp_dx, undefined, 'Object.prototype must not be polluted');
583583
assert.deepEqual(result, { safe: 'value' }, 'safe field must still be returned');
584584
});
@@ -587,7 +587,7 @@ QUnit.module('prototype pollution protection', {
587587
const obj = { a: null, safe: 'value' };
588588
const result = GETTER(['a.constructor.prototype.pp_dx2', 'safe'])(obj, { defaultValue: 'default' });
589589

590-
assert.strictEqual(errors.log.calledWith('E0123', 'constructor'), true, 'should log E0123 for constructor');
590+
assert.strictEqual(errors.log.calledWith('E0123', 'compileGetter', 'constructor'), true, 'should log E0123 for constructor');
591591
assert.strictEqual(({}).pp_dx2, undefined, 'Object.prototype must not be polluted');
592592
assert.deepEqual(result, { safe: 'value' }, 'safe field must still be returned');
593593
});

0 commit comments

Comments
 (0)