@@ -250,6 +250,60 @@ describe("Bedrock Component", () => {
250250 } )
251251 } )
252252
253+ // Test Scenario 3: UI Elements Tests
254+ describe ( "UI Elements" , ( ) => {
255+ it ( "should display example URLs when VPC endpoint checkbox is checked" , ( ) => {
256+ const apiConfiguration : Partial < ProviderSettings > = {
257+ awsBedrockEndpoint : "https://example.com" ,
258+ awsBedrockEndpointEnabled : true ,
259+ awsUseProfile : true ,
260+ }
261+
262+ render (
263+ < Bedrock
264+ apiConfiguration = { apiConfiguration as ProviderSettings }
265+ setApiConfigurationField = { mockSetApiConfigurationField }
266+ /> ,
267+ )
268+
269+ // Check that the VPC endpoint input is visible
270+ expect ( screen . getByTestId ( "vpc-endpoint-input" ) ) . toBeInTheDocument ( )
271+
272+ // Check for the example URLs section
273+ // Since we don't have a specific testid for the examples section,
274+ // we'll check for the text content
275+ expect ( screen . getByText ( "Examples:" ) ) . toBeInTheDocument ( )
276+ expect ( screen . getByText ( "• https://vpce-xxx.bedrock.region.vpce.amazonaws.com/" ) ) . toBeInTheDocument ( )
277+ expect ( screen . getByText ( "• https://gateway.my-company.com/route/app/bedrock" ) ) . toBeInTheDocument ( )
278+ } )
279+
280+ it ( "should hide example URLs when VPC endpoint checkbox is unchecked" , ( ) => {
281+ const apiConfiguration : Partial < ProviderSettings > = {
282+ awsBedrockEndpoint : "https://example.com" ,
283+ awsBedrockEndpointEnabled : true ,
284+ awsUseProfile : true ,
285+ }
286+
287+ render (
288+ < Bedrock
289+ apiConfiguration = { apiConfiguration as ProviderSettings }
290+ setApiConfigurationField = { mockSetApiConfigurationField }
291+ /> ,
292+ )
293+
294+ // Initially the examples should be visible
295+ expect ( screen . getByText ( "Examples:" ) ) . toBeInTheDocument ( )
296+
297+ // Uncheck the VPC endpoint checkbox
298+ fireEvent . click ( screen . getByTestId ( "checkbox-input-use-custom-vpc-endpoint" ) )
299+
300+ // Now the examples should be hidden
301+ expect ( screen . queryByText ( "Examples:" ) ) . not . toBeInTheDocument ( )
302+ expect ( screen . queryByText ( "• https://vpce-xxx.bedrock.region.vpce.amazonaws.com/" ) ) . not . toBeInTheDocument ( )
303+ expect ( screen . queryByText ( "• https://gateway.my-company.com/route/app/bedrock" ) ) . not . toBeInTheDocument ( )
304+ } )
305+ } )
306+
253307 // Test Scenario 4: Error Handling Tests
254308 describe ( "Error Handling" , ( ) => {
255309 it ( "should handle invalid endpoint URLs gracefully" , ( ) => {
0 commit comments