Skip to content

Commit a0128f4

Browse files
committed
Remove unused helper function
1 parent 53769ba commit a0128f4

File tree

2 files changed

+1
-23
lines changed

2 files changed

+1
-23
lines changed

src/lib/core/testing/dispatch-events.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import {
22
createFakeEvent,
33
createKeyboardEvent,
4-
createMouseEvent,
5-
createTransitionEndEvent
4+
createMouseEvent
65
} from './event-objects';
76

87
/** Shorthand to dispatch a fake event on a specified node. */
@@ -19,8 +18,3 @@ export function dispatchKeyboardEvent(node: Node, type: string, keyCode: number)
1918
export function dispatchMouseEvent(node: Node, type: string, x = 0, y = 0) {
2019
node.dispatchEvent(createMouseEvent(type, x, y));
2120
}
22-
23-
/** Shorthand to dispatch a transition event with a specified property. */
24-
export function dispatchTransitionEndEvent(node: Node, propertyName: string, elapsedTime = 0) {
25-
node.dispatchEvent(createTransitionEndEvent(propertyName, elapsedTime));
26-
}

src/lib/core/testing/event-objects.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,6 @@ export function createKeyboardEvent(type: string, keyCode: number) {
3838
return event;
3939
}
4040

41-
/** Creates a transition event with the specified property name. */
42-
export function createTransitionEndEvent(propertyName: string, elapsedTime = 0) {
43-
// Some browsers have the TransitionEvent class, but once the class is being instantiated
44-
// the browser will throw an exception. Those browsers don't support the constructor yet.
45-
// To ensure that those browsers also work, the TransitionEvent is created by using the
46-
// deprecated `initTransitionEvent` function.
47-
try {
48-
// TypeScript does not have valid types for the TransitionEvent class, so use `any`.
49-
return new (TransitionEvent as any)('transitionend', {propertyName, elapsedTime});
50-
} catch (e) {
51-
let event = document.createEvent('TransitionEvent');
52-
event.initTransitionEvent('transitionend', false, false, propertyName, elapsedTime);
53-
return event;
54-
}
55-
}
56-
5741
/** Creates a fake event object with any desired event type. */
5842
export function createFakeEvent(type: string) {
5943
let event = document.createEvent('Event');

0 commit comments

Comments
 (0)