Skip to content

Commit 1391d3d

Browse files
✅ Add JS specs for Instabug.setSdkDebugLogsLevel
1 parent 6fdd10a commit 1391d3d

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

__tests__/index.spec.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ describe('Instabug Module', () => {
4646
const logDebug = sinon.spy(NativeModules.Instabug, 'logDebug');
4747
const clearLogs = sinon.spy(NativeModules.Instabug, 'clearLogs');
4848
const setReproStepsMode = sinon.spy(NativeModules.Instabug, 'setReproStepsMode');
49+
const setSdkDebugLogsLevel = sinon.spy(NativeModules.Instabug, 'setSdkDebugLogsLevel');
4950
const setUserAttribute = sinon.spy(NativeModules.Instabug, 'setUserAttribute');
5051
const getUserAttribute = sinon.spy(NativeModules.Instabug, 'getUserAttribute');
5152
const removeUserAttribute = sinon.spy(NativeModules.Instabug, 'removeUserAttribute');
@@ -351,6 +352,13 @@ describe('Instabug Module', () => {
351352

352353
});
353354

355+
it('should call the native method setSdkDebugLogsLevel', () => {
356+
const debugLevel = Instabug.sdkDebugLogsLevel.sdkDebugLogsLevelVerbose;
357+
Instabug.setSdkDebugLogsLevel(debugLevel);
358+
359+
expect(setSdkDebugLogsLevel.calledOnceWithExactly(debugLevel)).toBe(true);
360+
});
361+
354362
it('should call the native method setUserAttribute', () => {
355363

356364
const key = 'age';

jest/mockInstabug.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jest.mock('NativeModules', () => {
2626
logDebug: jest.fn(),
2727
clearLogs: jest.fn(),
2828
setReproStepsMode: jest.fn(),
29+
setSdkDebugLogsLevel: jest.fn(),
2930
setUserAttribute: jest.fn(),
3031
getUserAttribute: jest.fn((_, cb) => cb('24')),
3132
removeUserAttribute: jest.fn(),

0 commit comments

Comments
 (0)