22// Use of this source code is governed by a BSD-style license that can be
33// found in the LICENSE file.
44
5- import { describeWithEnvironment , updateHostConfig } from '../../testing/EnvironmentHelpers.js' ;
5+ import {
6+ describeWithEnvironment ,
7+ restoreUserAgentForTesting ,
8+ setUserAgentForTesting ,
9+ updateHostConfig
10+ } from '../../testing/EnvironmentHelpers.js' ;
611
712import * as Host from './host.js' ;
813
914const TEST_MODEL_ID = 'testModelId' ;
1015
1116describeWithEnvironment ( 'AidaClient' , ( ) => {
17+ beforeEach ( ( ) => {
18+ setUserAgentForTesting ( ) ;
19+ } ) ;
20+
21+ afterEach ( ( ) => {
22+ restoreUserAgentForTesting ( ) ;
23+ } ) ;
24+
1225 it ( 'adds no model temperature if console insights is not enabled' , ( ) => {
1326 updateHostConfig ( {
1427 aidaAvailability : {
@@ -21,6 +34,10 @@ describeWithEnvironment('AidaClient', () => {
2134 client : 'CHROME_DEVTOOLS' ,
2235 client_feature : 1 ,
2336 functionality_type : 2 ,
37+ metadata : {
38+ disable_user_content_logging : false ,
39+ client_version : 'unit_test' ,
40+ } ,
2441 } ) ;
2542 } ) ;
2643
@@ -43,6 +60,10 @@ describeWithEnvironment('AidaClient', () => {
4360 } ,
4461 client_feature : 1 ,
4562 functionality_type : 2 ,
63+ metadata : {
64+ disable_user_content_logging : false ,
65+ client_version : 'unit_test' ,
66+ } ,
4667 } ) ;
4768 } ) ;
4869
@@ -65,6 +86,10 @@ describeWithEnvironment('AidaClient', () => {
6586 } ,
6687 client_feature : 1 ,
6788 functionality_type : 2 ,
89+ metadata : {
90+ disable_user_content_logging : false ,
91+ client_version : 'unit_test' ,
92+ } ,
6893 } ) ;
6994 } ) ;
7095
@@ -84,6 +109,10 @@ describeWithEnvironment('AidaClient', () => {
84109 client : 'CHROME_DEVTOOLS' ,
85110 client_feature : 1 ,
86111 functionality_type : 2 ,
112+ metadata : {
113+ disable_user_content_logging : false ,
114+ client_version : 'unit_test' ,
115+ } ,
87116 } ) ;
88117 } ) ;
89118
@@ -108,6 +137,10 @@ describeWithEnvironment('AidaClient', () => {
108137 } ,
109138 client_feature : 1 ,
110139 functionality_type : 2 ,
140+ metadata : {
141+ disable_user_content_logging : false ,
142+ client_version : 'unit_test' ,
143+ } ,
111144 } ) ;
112145 } ) ;
113146
@@ -127,6 +160,7 @@ describeWithEnvironment('AidaClient', () => {
127160 client : 'CHROME_DEVTOOLS' ,
128161 metadata : {
129162 disable_user_content_logging : true ,
163+ client_version : 'unit_test' ,
130164 } ,
131165 options : {
132166 temperature : 0.5 ,
0 commit comments