@@ -211,23 +211,32 @@ describe("WSEditorClientConfigDialog", () => {
211211
212212 it ( "should validate cloud metadata selector index when prefix is provided" , async ( ) => {
213213 const user = userEvent . setup ( ) ;
214+
214215 render ( < WSEditorClientConfigDialog workspaceUrl = { mockWorkspaceUrl } open = { true } onClose = { mockOnClose } /> ) ;
215216
216217 await waitFor ( ( ) => {
217- expect ( screen . getByLabelText ( "Azure Cloud ") ) . toBeInTheDocument ( ) ;
218+ expect ( screen . getByText ( "Setup Client Config ") ) . toBeInTheDocument ( ) ;
218219 } ) ;
219220
220- const azureCloudInput = screen . getByLabelText ( "Azure Cloud" ) ;
221- await user . type ( azureCloudInput , "https://{vaultName}.vault.azure.net" ) ;
221+ const azureInput = screen . getByPlaceholderText (
222+ / E n d p o i n t t e m p l a t e i n A z u r e C l o u d , e .g . h t t p s : \/ \/ \{ v a u l t N a m e \} \. v a u l t \. a z u r e \. n e t / i,
223+ ) ;
224+ await user . type ( azureInput , "https://management.azure.com" ) ;
222225
223226 const prefixInput = screen . getByLabelText ( "Prefix" ) ;
224227 await user . type ( prefixInput , "https://{vaultName}" ) ;
225228
229+ const aadInput = screen . getByPlaceholderText ( / I n p u t M i c r o s o f t E n t r a \( A A D \) a u t h S c o p e h e r e / i) ;
230+ await user . type ( aadInput , "dummy" ) ;
231+ await user . clear ( aadInput ) ;
232+
226233 const updateButton = screen . getByText ( "Update" ) ;
227234 await user . click ( updateButton ) ;
228235
229236 await waitFor ( ( ) => {
230- expect ( screen . getByText ( "Cloud Metadata Selector Index is required." ) ) . toBeInTheDocument ( ) ;
237+ expect (
238+ screen . getByText ( ( content ) => content . includes ( "Cloud Metadata Selector Index is required." ) ) ,
239+ ) . toBeInTheDocument ( ) ;
231240 } ) ;
232241 } ) ;
233242
0 commit comments