Skip to content

Commit

Permalink
Write a unit test for the case when enabled is false
Browse files Browse the repository at this point in the history
  • Loading branch information
ziyad-elabid-nw committed Oct 8, 2023
1 parent f99403c commit 369b566
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/sdk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({});

Expand Down

0 comments on commit 369b566

Please sign in to comment.