From 369b56660d2290525effc20227abfb6ab892809e Mon Sep 17 00:00:00 2001 From: ziyad-elabid-nw Date: Sun, 8 Oct 2023 01:02:52 +0100 Subject: [PATCH] Write a unit test for the case when enabled is false --- test/sdk.test.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/sdk.test.ts b/test/sdk.test.ts index 00ebd6eeb1..5eea3dfba8 100644 --- a/test/sdk.test.ts +++ b/test/sdk.test.ts @@ -448,6 +448,20 @@ describe('Tests the SDK functionality', () => { expect(actualIntegrations).toEqual(expect.arrayContaining([expect.objectContaining({ name: 'Screenshot' })])); }); + it('Should not add screenshot integration when the SDK is disabled', () => { + init({ + attachScreenshot: true, + enabled: false, + }); + + const actualOptions = mockedInitAndBind.mock.calls[0][secondArg] as ReactNativeClientOptions; + const actualIntegrations = actualOptions.integrations; + + expect(actualIntegrations).not.toContain( + expect.arrayContaining([expect.objectContaining({ name: 'Screenshot' })]), + ); + }); + it('no view hierarchy integration by default', () => { init({});