@@ -29,7 +29,7 @@ export class UIInteractions {
2929 * @param ctrl - if the ctrl key is pressed.
3030 */
3131 public static simulateClickAndSelectEvent ( element , shift = false , ctrl = false ) {
32- const nativeElement = element . nativeElement ? element . nativeElement : element ;
32+ const nativeElement = element . nativeElement ?? element ;
3333 UIInteractions . simulatePointerOverElementEvent ( 'pointerdown' , nativeElement , shift , ctrl ) ;
3434 nativeElement . dispatchEvent ( new MouseEvent ( 'focus' , { bubbles : true } ) ) ;
3535 UIInteractions . simulatePointerOverElementEvent ( 'pointerup' , nativeElement ) ;
@@ -41,7 +41,7 @@ export class UIInteractions {
4141 * @param element - Native or debug element.
4242 */
4343 public static simulateDoubleClickAndSelectEvent ( element ) {
44- const nativeElement = element . nativeElement ? element . nativeElement : element ;
44+ const nativeElement = element . nativeElement ?? element ;
4545 UIInteractions . simulatePointerOverElementEvent ( 'pointerdown' , nativeElement ) ;
4646 UIInteractions . simulatePointerOverElementEvent ( 'pointerup' , nativeElement ) ;
4747 nativeElement . dispatchEvent ( new MouseEvent ( 'dblclick' ) ) ;
@@ -52,7 +52,7 @@ export class UIInteractions {
5252 * @param element - Native or debug element.
5353 */
5454 public static simulateNonPrimaryClick ( element ) {
55- const nativeElement = element . nativeElement ? element . nativeElement : element ;
55+ const nativeElement = element . nativeElement ?? element ;
5656 nativeElement . dispatchEvent ( new PointerEvent ( 'pointerdown' , { button : 2 } ) ) ;
5757 nativeElement . dispatchEvent ( new Event ( 'focus' ) ) ;
5858 nativeElement . dispatchEvent ( new PointerEvent ( 'pointerup' , { button : 2 } ) ) ;
@@ -141,7 +141,7 @@ export class UIInteractions {
141141 * @param fix - if fixture is set it will detect changes on it.
142142 */
143143 public static clickAndSendInputElementValue ( element , text , fix = null ) {
144- const nativeElement = element . nativeElement ? element . nativeElement : element ;
144+ const nativeElement = element . nativeElement ?? element ;
145145 nativeElement . value = text ;
146146 nativeElement . dispatchEvent ( new Event ( 'keydown' ) ) ;
147147 nativeElement . dispatchEvent ( new Event ( 'input' ) ) ;
@@ -158,7 +158,7 @@ export class UIInteractions {
158158 * @param fix - if fixture is set it will detect changes on it.
159159 */
160160 public static setInputElementValue ( element , text , fix = null ) {
161- const nativeElement = element . nativeElement ? element . nativeElement : element ;
161+ const nativeElement = element . nativeElement ?? element ;
162162 nativeElement . value = text ;
163163 nativeElement . dispatchEvent ( new Event ( 'input' ) ) ;
164164 if ( fix ) {
0 commit comments