MCPcopy Create free account
hub / github.com/angular/angular / testAddRemove

Function testAddRemove

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

Source from the content-addressed store, hash-verified

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