You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/automated/src/data/observable-tests.ts
+18-15
Original file line number
Diff line number
Diff line change
@@ -286,8 +286,8 @@ export var test_Observable_identity = function () {
286
286
287
287
// If you try to add the same callback for a given event name twice, without
288
288
// distinguishing by its thisArg, the second addition will no-op.
289
-
obj.addEventListener(eventName,callback);
290
-
obj.addEventListener(eventName,callback);
289
+
obj.addEventListener(eventName,callback,false);
290
+
obj.addEventListener(eventName,callback,false);
291
291
obj.set('testName',1);
292
292
TKUnit.assert(receivedCount===1,'Expected Observable to fire exactly once upon a property change, having passed the same callback into addEventListener() twice');
293
293
obj.removeEventListener(eventName,callback);
@@ -296,9 +296,9 @@ export var test_Observable_identity = function () {
296
296
297
297
// All truthy thisArgs are distinct, so we have three distinct identities here
298
298
// and they should all get added.
299
-
obj.addEventListener(eventName,callback);
300
-
obj.addEventListener(eventName,callback,1);
301
-
obj.addEventListener(eventName,callback,2);
299
+
obj.addEventListener(eventName,callback,false);
300
+
obj.addEventListener(eventName,callback,false,1);
301
+
obj.addEventListener(eventName,callback,false,2);
302
302
obj.set('testName',2);
303
303
TKUnit.assert(receivedCount===3,'Expected Observable to fire exactly three times upon a property change, having passed the same callback into addEventListener() three times, with the latter two distinguished by each having a different truthy thisArg');
304
304
obj.removeEventListener(eventName,callback);
@@ -307,24 +307,24 @@ export var test_Observable_identity = function () {
307
307
308
308
// If you specify thisArg when removing an event listener, it should remove
309
309
// just the event listener with the corresponding thisArg.
310
-
obj.addEventListener(eventName,callback,1);
311
-
obj.addEventListener(eventName,callback,2);
310
+
obj.addEventListener(eventName,callback,false,1);
311
+
obj.addEventListener(eventName,callback,false,2);
312
312
obj.set('testName',3);
313
313
TKUnit.assert(receivedCount===2,'Expected Observable to fire exactly three times upon a property change, having passed the same callback into addEventListener() three times, with the latter two distinguished by each having a different truthy thisArg');
TKUnit.assert(obj.hasListeners(eventName),'Expected removeEventListener(eventName, callback, thisArg) to remove just the event listener that matched the callback and thisArg');
TKUnit.assert(!obj.hasListeners(eventName),'Expected removeEventListener(eventName, callback, thisArg) to remove the remaining event listener that matched the callback and thisArg');
318
318
receivedCount=0;
319
319
320
320
// All falsy thisArgs are treated alike, so these all have the same identity
TKUnit.assert(receivedCount===1,'Expected Observable to fire exactly once upon a property change, having passed the same callback into addEventListener() multiple times, each time with a different falsy (and therefore indistinct) thisArg');
330
330
obj.removeEventListener(eventName,callback);
@@ -376,7 +376,10 @@ export var test_Observable_removeEventListener_SingleEvent_NoCallbackSpecified =
0 commit comments