@@ -20,24 +20,21 @@ import InstabugUtils from '../utils/InstabugUtils';
2020
2121describe ( 'Instabug Module' , ( ) => {
2222
23- const startWithToken = sinon . spy ( NativeModules . Instabug , 'startWithToken ' ) ;
23+ const start = sinon . spy ( NativeModules . Instabug , 'start ' ) ;
2424 const setUserData = sinon . spy ( NativeModules . Instabug , 'setUserData' ) ;
2525 const setTrackUserSteps = sinon . spy ( NativeModules . Instabug , 'setTrackUserSteps' ) ;
2626 const setIBGLogPrintsToConsole = sinon . spy ( NativeModules . Instabug , 'setIBGLogPrintsToConsole' ) ;
2727 const setSessionProfilerEnabled = sinon . spy ( NativeModules . Instabug , 'setSessionProfilerEnabled' ) ;
28- const setPushNotificationsEnabled = sinon . spy ( NativeModules . IBGReplies , 'setPushNotificationsEnabled' ) ;
29- const setFloatingButtonEdge = sinon . spy ( NativeModules . IBGBugReporting , 'setFloatingButtonEdge' ) ;
3028 const setLocale = sinon . spy ( NativeModules . Instabug , 'setLocale' ) ;
3129 const setColorTheme = sinon . spy ( NativeModules . Instabug , 'setColorTheme' ) ;
3230 const setPrimaryColor = sinon . spy ( NativeModules . Instabug , 'setPrimaryColor' ) ;
3331 const appendTags = sinon . spy ( NativeModules . Instabug , 'appendTags' ) ;
3432 const resetTags = sinon . spy ( NativeModules . Instabug , 'resetTags' ) ;
3533 const getTags = sinon . spy ( NativeModules . Instabug , 'getTags' ) ;
3634 const setString = sinon . spy ( NativeModules . Instabug , 'setString' ) ;
37- const setEnabledAttachmentTypes = sinon . spy ( NativeModules . IBGBugReporting , 'setEnabledAttachmentTypes' ) ;
38- const identifyUserWithEmail = sinon . spy ( NativeModules . Instabug , 'identifyUserWithEmail' ) ;
35+ const identifyUser = sinon . spy ( NativeModules . Instabug , 'identifyUser' ) ;
3936 const logOut = sinon . spy ( NativeModules . Instabug , 'logOut' ) ;
40- const logUserEventWithName = sinon . spy ( NativeModules . Instabug , 'logUserEventWithName ' ) ;
37+ const logUserEvent = sinon . spy ( NativeModules . Instabug , 'logUserEvent ' ) ;
4138 const log = sinon . spy ( NativeModules . Instabug , 'log' ) ;
4239 const logVerbose = sinon . spy ( NativeModules . Instabug , 'logVerbose' ) ;
4340 const logInfo = sinon . spy ( NativeModules . Instabug , 'logInfo' ) ;
@@ -71,10 +68,9 @@ describe('Instabug Module', () => {
7168 const clearAllExperiments = sinon . spy ( NativeModules . Instabug , 'clearAllExperiments' ) ;
7269
7370 beforeEach ( ( ) => {
74- startWithToken . resetHistory ( ) ;
71+ start . resetHistory ( ) ;
7572 setTrackUserSteps . resetHistory ( ) ;
7673 setIBGLogPrintsToConsole . resetHistory ( ) ;
77- setPushNotificationsEnabled . resetHistory ( ) ;
7874 log . resetHistory ( ) ;
7975 setSdkDebugLogsLevel . resetHistory ( ) ;
8076 setDebugEnabled . resetHistory ( ) ;
@@ -104,25 +100,25 @@ describe('Instabug Module', () => {
104100 expect ( reportScreenChange . calledOnceWithExactly ( screenName ) ) . toBe ( true ) ;
105101 } ) ;
106102
107- it ( 'should call the native method startWithToken ' , ( ) => {
103+ it ( 'should call the native method start ' , ( ) => {
108104
109105 Platform . OS = 'ios' ;
110106 const token = 'some-token' ;
111107 const invocationEvents = [ Instabug . invocationEvent . floatingButton , Instabug . invocationEvent . shake ] ;
112108 Instabug . start ( token , invocationEvents ) ;
113109
114- expect ( startWithToken . calledOnceWithExactly ( token , invocationEvents ) ) . toBe ( true ) ;
110+ expect ( start . calledOnceWithExactly ( token , invocationEvents ) ) . toBe ( true ) ;
115111
116112 } ) ;
117113
118- // it('should not call the native method startWithToken when platform is android', () => {
114+ // it('should not call the native method start when platform is android', () => {
119115
120116 // Platform.OS = 'android';
121117 // const token = 'some-token';
122118 // const invocationEvents = [Instabug.invocationEvent.floatingButton, Instabug.invocationEvent.shake];
123119 // Instabug.start(token, invocationEvents);
124120
125- // expect(startWithToken .calledOnceWithExactly(token, invocationEvents)).toBe(true);
121+ // expect(start .calledOnceWithExactly(token, invocationEvents)).toBe(true);
126122
127123 // });
128124
@@ -179,25 +175,6 @@ describe('Instabug Module', () => {
179175
180176 } ) ;
181177
182- it ( 'should call the native method setPushNotificationsEnabled' , ( ) => {
183-
184- Platform . OS = 'ios' ;
185- Instabug . setPushNotificationsEnabled ( true ) ;
186-
187- expect ( setPushNotificationsEnabled . calledOnceWithExactly ( true ) ) . toBe ( true ) ;
188-
189- } ) ;
190-
191- it ( 'should call the native method setFloatingButtonEdge' , ( ) => {
192-
193- const offsetFromTop = 10 ;
194- const edge = Instabug . floatingButtonEdge . left ;
195- Instabug . setFloatingButtonEdge ( edge , offsetFromTop ) ;
196-
197- expect ( setFloatingButtonEdge . calledOnceWithExactly ( edge , offsetFromTop ) ) . toBe ( true ) ;
198-
199- } ) ;
200-
201178 it ( 'should call the native method setLocale' , ( ) => {
202179
203180 const locale = Instabug . locale . english ;
@@ -263,22 +240,14 @@ describe('Instabug Module', () => {
263240
264241 } ) ;
265242
266- it ( 'should call the native method setEnabledAttachmentTypes' , ( ) => {
267-
268- Instabug . setEnabledAttachmentTypes ( true , true , false , true ) ;
269-
270- expect ( setEnabledAttachmentTypes . calledOnceWithExactly ( true , true , false , true ) ) . toBe ( true ) ;
271-
272- } ) ;
273-
274- it ( 'should call the native method identifyUserWithEmail' , ( ) => {
243+ it ( 'should call the native method identifyUser' , ( ) => {
275244
276245
277246 const email = 'foo@instabug.com' ;
278247 const name = 'Instabug' ;
279248 Instabug . identifyUser ( email , name ) ;
280249
281- expect ( identifyUserWithEmail . calledOnceWithExactly ( email , name ) ) . toBe ( true ) ;
250+ expect ( identifyUser . calledOnceWithExactly ( email , name ) ) . toBe ( true ) ;
282251
283252 } ) ;
284253
@@ -290,12 +259,12 @@ describe('Instabug Module', () => {
290259
291260 } ) ;
292261
293- it ( 'should call the native method logUserEventWithName ' , ( ) => {
262+ it ( 'should call the native method logUserEvent ' , ( ) => {
294263
295264 const event = 'click' ;
296265 Instabug . logUserEvent ( event ) ;
297266
298- expect ( logUserEventWithName . calledOnceWithExactly ( event ) ) . toBe ( true ) ;
267+ expect ( logUserEvent . calledOnceWithExactly ( event ) ) . toBe ( true ) ;
299268
300269 } ) ;
301270
0 commit comments