Skip to content

Commit 8b2914f

Browse files
committed
update tests
1 parent a79d0ed commit 8b2914f

File tree

1 file changed

+11
-0
lines changed
  • dev-packages/browser-integration-tests/suites/integrations/featureFlags/growthbook/onError/basic

1 file changed

+11
-0
lines changed

dev-packages/browser-integration-tests/suites/integrations/featureFlags/growthbook/onError/basic/test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ sentryTest('GrowthBook onError: basic eviction/update and no async tasks', async
3131

3232
gb.__setOn('feat3', true);
3333
gb.isOn('feat3'); // update
34+
35+
// Test getFeatureValue with boolean values (should be captured)
36+
gb.__setFeatureValue('bool-feat', true);
37+
gb.getFeatureValue('bool-feat', false);
38+
39+
// Test getFeatureValue with non-boolean values (should be ignored)
40+
gb.__setFeatureValue('string-feat', 'hello');
41+
gb.getFeatureValue('string-feat', 'default');
42+
gb.__setFeatureValue('number-feat', 42);
43+
gb.getFeatureValue('number-feat', 0);
3444
}, FLAG_BUFFER_SIZE);
3545

3646
const reqPromise = waitForErrorRequest(page);
@@ -45,6 +55,7 @@ sentryTest('GrowthBook onError: basic eviction/update and no async tasks', async
4555
}
4656
expectedFlags.push({ flag: `feat${FLAG_BUFFER_SIZE + 1}`, result: true });
4757
expectedFlags.push({ flag: 'feat3', result: true });
58+
expectedFlags.push({ flag: 'bool-feat', result: true }); // Only boolean getFeatureValue should be captured
4859

4960
expect(values).toEqual(expectedFlags);
5061
});

0 commit comments

Comments
 (0)