|
1 | 1 | import { Type } from '@angular/core'; |
2 | 2 | import { ComponentFixture } from '@angular/core/testing'; |
| 3 | +import { getQueriesForElement, FireObject } from 'dom-testing-library'; |
3 | 4 |
|
4 | | -export interface Result<T> { |
| 5 | +export interface RenderResult extends ReturnType<typeof getQueriesForElement>, FireObject { |
5 | 6 | container: HTMLElement; |
6 | | - getFromTestBed: (token: any, notFoundValue?: any) => any; |
7 | 7 | debug: () => void; |
| 8 | + getFromTestBed: (token: any, notFoundValue?: any) => any; |
8 | 9 | fixture: ComponentFixture<any>; |
9 | | - |
10 | | - // Currently this isn't perfect because the typings from dom-testing-library are for TS 2.8 |
11 | | - // dom-testing-library queroes |
12 | | - queryByPlaceholderText: any; |
13 | | - queryAllByPlaceholderText: any; |
14 | | - getByPlaceholderText: any; |
15 | | - getAllByPlaceholderText: any; |
16 | | - queryByText: any; |
17 | | - queryAllByText: any; |
18 | | - getByText: any; |
19 | | - getAllByText: any; |
20 | | - queryByLabelText: any; |
21 | | - queryAllByLabelText: any; |
22 | | - getByLabelText: any; |
23 | | - getAllByLabelText: any; |
24 | | - queryByAltText: any; |
25 | | - queryAllByAltText: any; |
26 | | - getByAltText: any; |
27 | | - getAllByAltText: any; |
28 | | - queryByTestId: any; |
29 | | - queryAllByTestId: any; |
30 | | - getByTestId: any; |
31 | | - getAllByTestId: any; |
32 | | - queryByTitle: any; |
33 | | - queryAllByTitle: any; |
34 | | - getByTitle: any; |
35 | | - getAllByTitle: any; |
36 | | - queryByValue: any; |
37 | | - queryAllByValue: any; |
38 | | - getByValue: any; |
39 | | - getAllByValue: any; |
40 | | - |
41 | | - // dom-testing-library fireEvents |
42 | | - copy: (element: HTMLElement, options?: {}) => boolean; |
43 | | - cut: (element: HTMLElement, options?: {}) => boolean; |
44 | | - paste: (element: HTMLElement, options?: {}) => boolean; |
45 | | - compositionEnd: (element: HTMLElement, options?: {}) => boolean; |
46 | | - compositionStart: (element: HTMLElement, options?: {}) => boolean; |
47 | | - compositionUpdate: (element: HTMLElement, options?: {}) => boolean; |
48 | | - keyDown: (element: HTMLElement, options?: {}) => boolean; |
49 | | - keyPress: (element: HTMLElement, options?: {}) => boolean; |
50 | | - keyUp: (element: HTMLElement, options?: {}) => boolean; |
51 | | - focus: (element: HTMLElement, options?: {}) => boolean; |
52 | | - blur: (element: HTMLElement, options?: {}) => boolean; |
53 | | - change: (element: HTMLElement, options?: {}) => boolean; |
54 | | - input: (element: HTMLElement, options?: {}) => boolean; |
55 | | - invalid: (element: HTMLElement, options?: {}) => boolean; |
56 | | - submit: (element: HTMLElement, options?: {}) => boolean; |
57 | | - click: (element: HTMLElement, options?: {}) => boolean; |
58 | | - contextMenu: (element: HTMLElement, options?: {}) => boolean; |
59 | | - dblClick: (element: HTMLElement, options?: {}) => boolean; |
60 | | - drag: (element: HTMLElement, options?: {}) => boolean; |
61 | | - dragEnd: (element: HTMLElement, options?: {}) => boolean; |
62 | | - dragEnter: (element: HTMLElement, options?: {}) => boolean; |
63 | | - dragExit: (element: HTMLElement, options?: {}) => boolean; |
64 | | - dragLeave: (element: HTMLElement, options?: {}) => boolean; |
65 | | - dragOver: (element: HTMLElement, options?: {}) => boolean; |
66 | | - dragStart: (element: HTMLElement, options?: {}) => boolean; |
67 | | - drop: (element: HTMLElement, options?: {}) => boolean; |
68 | | - mouseDown: (element: HTMLElement, options?: {}) => boolean; |
69 | | - mouseEnter: (element: HTMLElement, options?: {}) => boolean; |
70 | | - mouseLeave: (element: HTMLElement, options?: {}) => boolean; |
71 | | - mouseMove: (element: HTMLElement, options?: {}) => boolean; |
72 | | - mouseOut: (element: HTMLElement, options?: {}) => boolean; |
73 | | - mouseOver: (element: HTMLElement, options?: {}) => boolean; |
74 | | - mouseUp: (element: HTMLElement, options?: {}) => boolean; |
75 | | - select: (element: HTMLElement, options?: {}) => boolean; |
76 | | - touchCancel: (element: HTMLElement, options?: {}) => boolean; |
77 | | - touchEnd: (element: HTMLElement, options?: {}) => boolean; |
78 | | - touchMove: (element: HTMLElement, options?: {}) => boolean; |
79 | | - touchStart: (element: HTMLElement, options?: {}) => boolean; |
80 | | - scroll: (element: HTMLElement, options?: {}) => boolean; |
81 | | - wheel: (element: HTMLElement, options?: {}) => boolean; |
82 | | - abort: (element: HTMLElement, options?: {}) => boolean; |
83 | | - canPlay: (element: HTMLElement, options?: {}) => boolean; |
84 | | - canPlayThrough: (element: HTMLElement, options?: {}) => boolean; |
85 | | - durationChange: (element: HTMLElement, options?: {}) => boolean; |
86 | | - emptied: (element: HTMLElement, options?: {}) => boolean; |
87 | | - encrypted: (element: HTMLElement, options?: {}) => boolean; |
88 | | - ended: (element: HTMLElement, options?: {}) => boolean; |
89 | | - loadedData: (element: HTMLElement, options?: {}) => boolean; |
90 | | - loadedMetadata: (element: HTMLElement, options?: {}) => boolean; |
91 | | - loadStart: (element: HTMLElement, options?: {}) => boolean; |
92 | | - pause: (element: HTMLElement, options?: {}) => boolean; |
93 | | - play: (element: HTMLElement, options?: {}) => boolean; |
94 | | - playing: (element: HTMLElement, options?: {}) => boolean; |
95 | | - progress: (element: HTMLElement, options?: {}) => boolean; |
96 | | - rateChange: (element: HTMLElement, options?: {}) => boolean; |
97 | | - seeked: (element: HTMLElement, options?: {}) => boolean; |
98 | | - seeking: (element: HTMLElement, options?: {}) => boolean; |
99 | | - stalled: (element: HTMLElement, options?: {}) => boolean; |
100 | | - suspend: (element: HTMLElement, options?: {}) => boolean; |
101 | | - timeUpdate: (element: HTMLElement, options?: {}) => boolean; |
102 | | - volumeChange: (element: HTMLElement, options?: {}) => boolean; |
103 | | - waiting: (element: HTMLElement, options?: {}) => boolean; |
104 | | - load: (element: HTMLElement, options?: {}) => boolean; |
105 | | - error: (element: HTMLElement, options?: {}) => boolean; |
106 | | - animationStart: (element: HTMLElement, options?: {}) => boolean; |
107 | | - animationEnd: (element: HTMLElement, options?: {}) => boolean; |
108 | | - animationIteration: (element: HTMLElement, options?: {}) => boolean; |
109 | | - transitionEnd: (element: HTMLElement, options?: {}) => boolean; |
110 | | - doubleClick: (element: HTMLElement, options?: {}) => boolean; |
111 | 10 | } |
112 | 11 |
|
113 | 12 | export interface Options { |
|
0 commit comments