@@ -64,13 +64,11 @@ export class UnitTestElement implements TestElement {
64
64
constructor ( readonly element : Element , private _stabilize : ( ) => Promise < void > ) { }
65
65
66
66
async blur ( ) : Promise < void > {
67
- await this . _stabilize ( ) ;
68
67
triggerBlur ( this . element as HTMLElement ) ;
69
68
await this . _stabilize ( ) ;
70
69
}
71
70
72
71
async clear ( ) : Promise < void > {
73
- await this . _stabilize ( ) ;
74
72
if ( ! isTextInput ( this . element ) ) {
75
73
throw Error ( 'Attempting to clear an invalid element' ) ;
76
74
}
@@ -93,12 +91,10 @@ export class UnitTestElement implements TestElement {
93
91
this . _dispatchPointerEventIfSupported ( 'pointerup' , clientX , clientY ) ;
94
92
dispatchMouseEvent ( this . element , 'mouseup' , clientX , clientY ) ;
95
93
dispatchMouseEvent ( this . element , 'click' , clientX , clientY ) ;
96
-
97
94
await this . _stabilize ( ) ;
98
95
}
99
96
100
97
async focus ( ) : Promise < void > {
101
- await this . _stabilize ( ) ;
102
98
triggerFocus ( this . element as HTMLElement ) ;
103
99
await this . _stabilize ( ) ;
104
100
}
@@ -111,14 +107,12 @@ export class UnitTestElement implements TestElement {
111
107
}
112
108
113
109
async hover ( ) : Promise < void > {
114
- await this . _stabilize ( ) ;
115
110
this . _dispatchPointerEventIfSupported ( 'pointerenter' ) ;
116
111
dispatchMouseEvent ( this . element , 'mouseenter' ) ;
117
112
await this . _stabilize ( ) ;
118
113
}
119
114
120
115
async mouseAway ( ) : Promise < void > {
121
- await this . _stabilize ( ) ;
122
116
this . _dispatchPointerEventIfSupported ( 'pointerleave' ) ;
123
117
dispatchMouseEvent ( this . element , 'mouseleave' ) ;
124
118
await this . _stabilize ( ) ;
@@ -127,7 +121,6 @@ export class UnitTestElement implements TestElement {
127
121
async sendKeys ( ...keys : ( string | TestKey ) [ ] ) : Promise < void > ;
128
122
async sendKeys ( modifiers : ModifierKeys , ...keys : ( string | TestKey ) [ ] ) : Promise < void > ;
129
123
async sendKeys ( ...modifiersAndKeys : any [ ] ) : Promise < void > {
130
- await this . _stabilize ( ) ;
131
124
const args = modifiersAndKeys . map ( k => typeof k === 'number' ? keyMap [ k as TestKey ] : k ) ;
132
125
typeInElement ( this . element as HTMLElement , ...args ) ;
133
126
await this . _stabilize ( ) ;
@@ -162,8 +155,8 @@ export class UnitTestElement implements TestElement {
162
155
}
163
156
164
157
async setInputValue ( value : string ) : Promise < void > {
165
- await this . _stabilize ( ) ;
166
158
( this . element as any ) . value = value ;
159
+ await this . _stabilize ( ) ;
167
160
}
168
161
169
162
async matchesSelector ( selector : string ) : Promise < boolean > {
0 commit comments