@@ -552,31 +552,55 @@ describe("Bedrock Component", () => {
552552 } )
553553 } )
554554
555- describe ( "custom ARN capabilities " , ( ) => {
555+ describe ( "1M context and service tier options " , ( ) => {
556556 const oneMillionCheckbox = "checkbox-settings:providers.awsbedrock1mcontextbetalabel"
557+ const serviceTierLabel = "settings:providers.awsServiceTier"
558+ const appProfileArn = "arn:aws:bedrock:us-west-2:123456789012:application-inference-profile/abcd1234efgh"
559+ const renderBedrock = ( settings : Partial < ProviderSettings > ) =>
560+ render ( < Bedrock apiConfiguration = { settings } setApiConfigurationField = { mockSetApiConfigurationField } /> )
557561 const renderCustomArn = ( awsCustomArnBaseModelId ?: string ) =>
558- render (
559- < Bedrock
560- apiConfiguration = { {
561- apiModelId : "custom-arn" ,
562- awsCustomArn :
563- "arn:aws:bedrock:us-west-2:123456789012:application-inference-profile/abcd1234efgh" ,
564- awsCustomArnBaseModelId,
565- } }
566- setApiConfigurationField = { mockSetApiConfigurationField }
567- /> ,
568- )
562+ renderBedrock ( { apiModelId : "custom-arn" , awsCustomArn : appProfileArn , awsCustomArnBaseModelId } )
563+
564+ it ( "offers the 1M context option, not service tiers, for a regular Opus 4.8 model" , ( ) => {
565+ renderBedrock ( { apiModelId : "anthropic.claude-opus-4-8" } )
566+
567+ expect ( screen . getByTestId ( oneMillionCheckbox ) ) . toBeInTheDocument ( )
568+ expect ( screen . queryByText ( serviceTierLabel ) ) . not . toBeInTheDocument ( )
569+ } )
570+
571+ it ( "offers service tiers, not the 1M context option, for a regular Nova model" , ( ) => {
572+ renderBedrock ( { apiModelId : "amazon.nova-lite-v1:0" } )
573+
574+ expect ( screen . getByText ( serviceTierLabel ) ) . toBeInTheDocument ( )
575+ expect ( screen . queryByTestId ( oneMillionCheckbox ) ) . not . toBeInTheDocument ( )
576+ } )
577+
578+ it ( "ignores a leftover custom ARN base model when a regular model is selected" , ( ) => {
579+ renderBedrock ( { apiModelId : "amazon.nova-lite-v1:0" , awsCustomArnBaseModelId : "anthropic.claude-opus-4-8" } )
580+
581+ expect ( screen . getByText ( serviceTierLabel ) ) . toBeInTheDocument ( )
582+ expect ( screen . queryByTestId ( oneMillionCheckbox ) ) . not . toBeInTheDocument ( )
583+ } )
569584
570585 it ( "offers the 1M context option when the custom ARN's base model supports it" , ( ) => {
571586 renderCustomArn ( "anthropic.claude-opus-4-8" )
572587
573588 expect ( screen . getByTestId ( oneMillionCheckbox ) ) . toBeInTheDocument ( )
589+ expect ( screen . queryByText ( serviceTierLabel ) ) . not . toBeInTheDocument ( )
590+ } )
591+
592+ it ( "offers service tiers when the custom ARN's base model supports them" , ( ) => {
593+ renderCustomArn ( "amazon.nova-lite-v1:0" )
594+
595+ expect ( screen . getByText ( serviceTierLabel ) ) . toBeInTheDocument ( )
596+ expect ( screen . queryByTestId ( oneMillionCheckbox ) ) . not . toBeInTheDocument ( )
574597 } )
575598
576- it ( "hides the 1M context option when the custom ARN's base model is unknown" , ( ) => {
599+ it ( "hides both options when the custom ARN's base model is unknown" , ( ) => {
577600 renderCustomArn ( )
578601
579602 expect ( screen . queryByTestId ( oneMillionCheckbox ) ) . not . toBeInTheDocument ( )
603+ expect ( screen . queryByText ( serviceTierLabel ) ) . not . toBeInTheDocument ( )
580604 } )
581605 } )
582606} )
0 commit comments