From e678553d7a38ecd5e8bbc8702266da55eb33ab5d Mon Sep 17 00:00:00 2001 From: Uriell Date: Wed, 24 Jul 2024 15:59:20 -0300 Subject: [PATCH] test(flagsmith): asserting boolean default parameter outside of constructor is also taken into account --- .../src/lib/flagsmith-client-provider.spec.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libs/providers/flagsmith-client/src/lib/flagsmith-client-provider.spec.ts b/libs/providers/flagsmith-client/src/lib/flagsmith-client-provider.spec.ts index c386276f6..b14a770f6 100644 --- a/libs/providers/flagsmith-client/src/lib/flagsmith-client-provider.spec.ts +++ b/libs/providers/flagsmith-client/src/lib/flagsmith-client-provider.spec.ts @@ -270,12 +270,18 @@ describe('FlagsmithProvider', () => { expect(details.value).toEqual(0); expect(details.reason).toEqual('ERROR'); }); - it('should use defaults for flags that do not exist', async () => { + it('should use defaults for number flags that do not exist', async () => { await OpenFeature.setProviderAndWait(provider); const details = client.getNumberDetails('dont exist', 0); expect(details.value).toEqual(0); expect(details.reason).toEqual('DEFAULT'); }); + it('should use defaults for boolean flags that do not exist', async () => { + await OpenFeature.setProviderAndWait(provider); + const details = client.getBooleanDetails('dont exist', false); + expect(details.value).toEqual(false); + expect(details.reason).toEqual('DEFAULT'); + }); }); describe('events', () => { it('should call the ready handler when initialized', async () => {