MCPcopy
hub / github.com/angular/angular / testAddRemove

Function testAddRemove

packages/zone.js/test/browser/browser.spec.ts:1263–1280  ·  view source on GitHub ↗
(args1?: any, args2?: any)

Source from the content-addressed store, hash-verified

1261 });
1262
1263 const testAddRemove = function (args1?: any, args2?: any) {
1264 zone.run(function () {
1265 if (args1) {
1266 (document as any).addEventListener('click', docListener, args1);
1267 } else {
1268 (document as any).addEventListener('click', docListener);
1269 }
1270 if (args2) {
1271 (document as any).removeEventListener('click', docListener, args2);
1272 } else {
1273 (document as any).removeEventListener('click', docListener);
1274 }
1275 });
1276
1277 button.dispatchEvent(clickEvent);
1278 expect(cancelSpy).toHaveBeenCalled();
1279 expect(logs).toEqual([]);
1280 };
1281
1282 it('should be able to add/remove same handler with mix options and capture', function () {
1283 let captureFalse = [

Callers 1

browser.spec.tsFile · 0.70

Calls 4

runMethod · 0.65
addEventListenerMethod · 0.65
removeEventListenerMethod · 0.65
dispatchEventMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…