@@ -7,6 +7,8 @@ import 'package:splitio_web/src/js_interop.dart';
77import 'package:splitio_platform_interface/split_certificate_pinning_configuration.dart' ;
88import 'package:splitio_platform_interface/split_sync_config.dart' ;
99import 'package:splitio_platform_interface/split_rollout_cache_configuration.dart' ;
10+ import 'package:splitio_platform_interface/split_fallback_treatment.dart' ;
11+ import 'package:splitio_platform_interface/split_fallback_treatments_configuration.dart' ;
1012import 'utils/js_interop_test_utils.dart' ;
1113
1214extension on web.Window {
@@ -685,39 +687,47 @@ void main() {
685687 matchingKey: 'matching-key' ,
686688 bucketingKey: 'bucketing-key' ,
687689 sdkConfiguration: SplitConfiguration (
688- featuresRefreshRate: 1 ,
689- segmentsRefreshRate: 2 ,
690- impressionsRefreshRate: 3 ,
691- telemetryRefreshRate: 4 ,
692- eventsQueueSize: 5 ,
693- impressionsQueueSize: 6 ,
694- eventFlushInterval: 7 ,
695- eventsPerPush: 8 , // unsupported in Web
696- trafficType: 'user' ,
697- // ignore: deprecated_member_use
698- enableDebug: false , // deprecated, logLevel has precedence
699- streamingEnabled: false ,
700- persistentAttributesEnabled: true , // unsupported in Web
701- impressionListener: true ,
702- sdkEndpoint: 'https://sdk.domain/api' ,
703- eventsEndpoint: 'https://events.domain/api' ,
704- authServiceEndpoint: 'https://auth.domain/api/v2' ,
705- streamingServiceEndpoint: 'https://streaming.domain/sse' ,
706- telemetryServiceEndpoint: 'https://telemetry.domain/api/v1' ,
707- syncConfig: SyncConfig (
708- names: ['flag_1' , 'flag_2' ], prefixes: ['prefix_1' ]),
709- impressionsMode: ImpressionsMode .none,
710- syncEnabled: true ,
711- userConsent: UserConsent .granted,
712- encryptionEnabled: true , // unsupported in Web
713- logLevel: SplitLogLevel .info,
714- readyTimeout: 1 ,
715- certificatePinningConfiguration: CertificatePinningConfiguration ()
716- .addPin ('host' , 'pin' ), // unsupported in Web
717- rolloutCacheConfiguration: RolloutCacheConfiguration (
718- expirationDays: 100 ,
719- clearOnInit: true ,
720- )));
690+ featuresRefreshRate: 1 ,
691+ segmentsRefreshRate: 2 ,
692+ impressionsRefreshRate: 3 ,
693+ telemetryRefreshRate: 4 ,
694+ eventsQueueSize: 5 ,
695+ impressionsQueueSize: 6 ,
696+ eventFlushInterval: 7 ,
697+ eventsPerPush: 8 , // unsupported in Web
698+ trafficType: 'user' ,
699+ // ignore: deprecated_member_use
700+ enableDebug: false , // deprecated, logLevel has precedence
701+ streamingEnabled: false ,
702+ persistentAttributesEnabled: true , // unsupported in Web
703+ impressionListener: true ,
704+ sdkEndpoint: 'https://sdk.domain/api' ,
705+ eventsEndpoint: 'https://events.domain/api' ,
706+ authServiceEndpoint: 'https://auth.domain/api/v2' ,
707+ streamingServiceEndpoint: 'https://streaming.domain/sse' ,
708+ telemetryServiceEndpoint: 'https://telemetry.domain/api/v1' ,
709+ syncConfig:
710+ SyncConfig (names: ['flag_1' , 'flag_2' ], prefixes: ['prefix_1' ]),
711+ impressionsMode: ImpressionsMode .none,
712+ syncEnabled: true ,
713+ userConsent: UserConsent .granted,
714+ encryptionEnabled: true , // unsupported in Web
715+ logLevel: SplitLogLevel .info,
716+ readyTimeout: 1 ,
717+ certificatePinningConfiguration: CertificatePinningConfiguration ()
718+ .addPin ('host' , 'pin' ), // unsupported in Web
719+ rolloutCacheConfiguration: RolloutCacheConfiguration (
720+ expirationDays: 100 ,
721+ clearOnInit: true ,
722+ ),
723+ fallbackTreatments: FallbackTreatmentsConfiguration (
724+ global: const FallbackTreatment ('global-treatment' ),
725+ byFlag: {
726+ 'flag_1' : const FallbackTreatment ('fallback_1' , 'config_1' ),
727+ 'flag_2' : const FallbackTreatment ('fallback_2' , null )
728+ },
729+ ),
730+ ));
721731
722732 expect (mock.calls[mock.calls.length - 5 ].methodName, 'SplitFactory' );
723733 final actual =
@@ -776,6 +786,13 @@ void main() {
776786 'impressionListener' : {
777787 'logImpression' : (actual as Map )['impressionListener' ]
778788 ['logImpression' ]
789+ },
790+ 'fallbackTreatments' : {
791+ 'global' : {'treatment' : 'global-treatment' , 'config' : null },
792+ 'byFlag' : {
793+ 'flag_1' : {'treatment' : 'fallback_1' , 'config' : 'config_1' },
794+ 'flag_2' : {'treatment' : 'fallback_2' , 'config' : null }
795+ }
779796 }
780797 }));
781798
0 commit comments