@@ -5,7 +5,12 @@ import { mapRequestFromState } from '@/Components/CreateImageWizard/utilities/re
55import { serviceMiddleware , serviceReducer } from '@/store' ;
66import { CreateBlueprintRequest , ImageRequest } from '@/store/api/backend' ;
77import { initialState } from '@/store/slices/wizard' ;
8- import { clickWithWait , createUser , typeWithWait } from '@/test/testUtils' ;
8+ import {
9+ clickWithWait ,
10+ createUser ,
11+ tabWithWait ,
12+ typeWithWait ,
13+ } from '@/test/testUtils' ;
914
1015import {
1116 checkAccountIdValue ,
@@ -82,7 +87,7 @@ describe('AWS Component', () => {
8287 name : / a w s a c c o u n t i d / i,
8388 } ) ;
8489 await typeWithWait ( user , accountIdInput , '12345' ) ;
85- await waitFor ( ( ) => accountIdInput . blur ( ) ) ;
90+ await tabWithWait ( user ) ;
8691
8792 await waitFor ( ( ) => {
8893 expect (
@@ -99,7 +104,7 @@ describe('AWS Component', () => {
99104 name : / a w s a c c o u n t i d / i,
100105 } ) ;
101106 await typeWithWait ( user , accountIdInput , 'abc123456789' ) ;
102- await waitFor ( ( ) => accountIdInput . blur ( ) ) ;
107+ await tabWithWait ( user ) ;
103108
104109 await waitFor ( ( ) => {
105110 expect (
@@ -110,12 +115,13 @@ describe('AWS Component', () => {
110115
111116 test ( 'displays error when field is focused then blurred without input' , async ( ) => {
112117 renderAwsStep ( ) ;
118+ const user = createUser ( ) ;
113119
114120 const accountIdInput = await screen . findByRole ( 'textbox' , {
115121 name : / a w s a c c o u n t i d / i,
116122 } ) ;
117123 accountIdInput . focus ( ) ;
118- await waitFor ( ( ) => accountIdInput . blur ( ) ) ;
124+ await tabWithWait ( user ) ;
119125
120126 await waitFor ( ( ) => {
121127 expect (
@@ -138,11 +144,7 @@ describe('AWS Component', () => {
138144 name : / c l e a r / i,
139145 } ) ;
140146 await clickWithWait ( user , clearButton ) ;
141-
142- const accountIdInput = await screen . findByRole ( 'textbox' , {
143- name : / a w s a c c o u n t i d / i,
144- } ) ;
145- await waitFor ( ( ) => accountIdInput . blur ( ) ) ;
147+ await tabWithWait ( user ) ;
146148
147149 await waitFor ( ( ) => {
148150 expect (
0 commit comments