MCPcopy
hub / github.com/angular/angular / testDuplicate

Function testDuplicate

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

Source from the content-addressed store, hash-verified

1168 });
1169
1170 const testDuplicate = function (args1?: any, args2?: any) {
1171 zone.run(function () {
1172 if (args1) {
1173 (document as any).addEventListener('click', docListener, args1);
1174 } else {
1175 (document as any).addEventListener('click', docListener);
1176 }
1177 if (args2) {
1178 (document as any).addEventListener('click', docListener, args2);
1179 } else {
1180 (document as any).addEventListener('click', docListener);
1181 }
1182 });
1183
1184 button.dispatchEvent(clickEvent);
1185 expect(hookSpy).toHaveBeenCalled();
1186 expect(logs).toEqual(['document options']);
1187 logs = [];
1188
1189 (document as any).removeEventListener('click', docListener, args1);
1190 expect(cancelSpy).toHaveBeenCalled();
1191 button.dispatchEvent(clickEvent);
1192 expect(logs).toEqual([]);
1193 };
1194
1195 it('should ignore duplicate handler', () => {
1196 let captureFalse = [

Callers 1

browser.spec.tsFile · 0.85

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…