@@ -57,13 +57,11 @@ export class UnitTestElement implements TestElement {
57
57
constructor ( readonly element : Element , private _stabilize : ( ) => Promise < void > ) { }
58
58
59
59
async blur ( ) : Promise < void > {
60
- await this . _stabilize ( ) ;
61
60
triggerBlur ( this . element as HTMLElement ) ;
62
61
await this . _stabilize ( ) ;
63
62
}
64
63
65
64
async clear ( ) : Promise < void > {
66
- await this . _stabilize ( ) ;
67
65
if ( ! isTextInput ( this . element ) ) {
68
66
throw Error ( 'Attempting to clear an invalid element' ) ;
69
67
}
@@ -86,12 +84,10 @@ export class UnitTestElement implements TestElement {
86
84
this . _dispatchPointerEventIfSupported ( 'pointerup' , clientX , clientY ) ;
87
85
dispatchMouseEvent ( this . element , 'mouseup' , clientX , clientY ) ;
88
86
dispatchMouseEvent ( this . element , 'click' , clientX , clientY ) ;
89
-
90
87
await this . _stabilize ( ) ;
91
88
}
92
89
93
90
async focus ( ) : Promise < void > {
94
- await this . _stabilize ( ) ;
95
91
triggerFocus ( this . element as HTMLElement ) ;
96
92
await this . _stabilize ( ) ;
97
93
}
@@ -104,14 +100,12 @@ export class UnitTestElement implements TestElement {
104
100
}
105
101
106
102
async hover ( ) : Promise < void > {
107
- await this . _stabilize ( ) ;
108
103
this . _dispatchPointerEventIfSupported ( 'pointerenter' ) ;
109
104
dispatchMouseEvent ( this . element , 'mouseenter' ) ;
110
105
await this . _stabilize ( ) ;
111
106
}
112
107
113
108
async mouseAway ( ) : Promise < void > {
114
- await this . _stabilize ( ) ;
115
109
this . _dispatchPointerEventIfSupported ( 'pointerleave' ) ;
116
110
dispatchMouseEvent ( this . element , 'mouseleave' ) ;
117
111
await this . _stabilize ( ) ;
@@ -120,7 +114,6 @@ export class UnitTestElement implements TestElement {
120
114
async sendKeys ( ...keys : ( string | TestKey ) [ ] ) : Promise < void > ;
121
115
async sendKeys ( modifiers : ModifierKeys , ...keys : ( string | TestKey ) [ ] ) : Promise < void > ;
122
116
async sendKeys ( ...modifiersAndKeys : any [ ] ) : Promise < void > {
123
- await this . _stabilize ( ) ;
124
117
const args = modifiersAndKeys . map ( k => typeof k === 'number' ? keyMap [ k as TestKey ] : k ) ;
125
118
typeInElement ( this . element as HTMLElement , ...args ) ;
126
119
await this . _stabilize ( ) ;
@@ -152,8 +145,8 @@ export class UnitTestElement implements TestElement {
152
145
}
153
146
154
147
async setInputValue ( value : string ) : Promise < void > {
155
- await this . _stabilize ( ) ;
156
148
( this . element as any ) . value = value ;
149
+ await this . _stabilize ( ) ;
157
150
}
158
151
159
152
async matchesSelector ( selector : string ) : Promise < boolean > {
0 commit comments