Fix remote config for configs with unspecified on-off values

This commit is contained in:
ayumi-signal
2025-09-02 16:42:04 -07:00
committed by GitHub
parent e98bb0750c
commit c09dc17867
3 changed files with 15 additions and 2 deletions

View File

@@ -139,6 +139,20 @@ describe('RemoteConfig', () => {
assert.equal(isEnabled('desktop.internalUser'), true);
});
it('is true for true string flag', async () => {
await updateRemoteConfig([
{ name: 'desktop.internalUser', value: 'true' },
]);
assert.equal(isEnabled('desktop.internalUser'), true);
});
it('is false for false string flag', async () => {
await updateRemoteConfig([
{ name: 'desktop.internalUser', value: 'false' },
]);
assert.equal(isEnabled('desktop.internalUser'), false);
});
it('reflects the value of an unknown flag in the config', async () => {
assert.equal(
isEnabled('desktop.unknownFlagName' as ConfigKeyType),