@@ -14,24 +14,14 @@ void main() {
1414 break ;
1515 case 'isFeatureEnabled' :
1616 var featureKey = methodCall.arguments['feature_key' ];
17- var userId = methodCall.arguments['user_id' ];
18- if (userId == 'user@pg.com' && featureKey == 'flutter' ) {
17+ if (featureKey == 'flutter' ) {
1918 return true ;
2019 }
2120 return false ;
2221 case 'getAllFeatureVariables' :
2322 var featureKey = methodCall.arguments['feature_key' ];
24- var userId = methodCall.arguments['user_id' ];
25- var attributes = methodCall.arguments['attributes' ];
26- if (featureKey == 'calculator' && userId == 'user@pg.com' ) {
27- switch (attributes['platform' ]) {
28- case 'ios' :
29- return {'calc_type' : 'scientific' };
30- case 'android' :
31- return {'calc_type' : 'basic' };
32- default :
33- return {};
34- }
23+ if (featureKey == 'calculator' ) {
24+ return {'calc_type' : 'scientific' };
3525 }
3626 return {};
3727 default :
@@ -60,28 +50,14 @@ void main() {
6050 final optimizelyPlugin = OptimizelyPlugin ();
6151 final enabled = await optimizelyPlugin.isFeatureEnabled (
6252 'flutter' ,
63- 'user@pg.com' ,
64- {'platform' : 'android' },
6553 );
6654 expect (enabled, true );
6755 });
6856
69- test ('getAllFeatureVariablesAndroid ' , () async {
57+ test ('getAllFeatureVariables ' , () async {
7058 final optimizelyPlugin = OptimizelyPlugin ();
7159 var features = await optimizelyPlugin.getAllFeatureVariables (
7260 'calculator' ,
73- 'user@pg.com' ,
74- {'platform' : 'android' },
75- );
76- expect (features['calc_type' ], 'basic' );
77- });
78-
79- test ('getAllFeatureVariablesApple' , () async {
80- final optimizelyPlugin = OptimizelyPlugin ();
81- var features = await optimizelyPlugin.getAllFeatureVariables (
82- 'calculator' ,
83- 'user@pg.com' ,
84- {'platform' : 'ios' },
8561 );
8662 expect (features['calc_type' ], 'scientific' );
8763 });
0 commit comments