Skip to content

Commit 50beca4

Browse files
committed
fix: unit tests
1 parent 5fa9874 commit 50beca4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/modules/Instabug.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ export const setColorTheme = (sdkTheme: ColorTheme) => {
384384
* To use, import processColor and pass to it with argument the color hex
385385
* as argument.
386386
* @param color A color to set the UI elements of the SDK to.
387-
* @platform iOS
387+
* @deprecated Please migrate to the new UI customization API: {@link setTheme}
388388
*/
389389
export const setPrimaryColor = (color: string) => {
390390
NativeInstabug.setTheme({ primaryColor: color });

test/modules/Instabug.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import '../mocks/mockInstabugUtils';
22
import '../mocks/mockNetworkLogger';
33

4-
import { findNodeHandle, Platform, processColor } from 'react-native';
4+
import { findNodeHandle, Platform } from 'react-native';
55
import type { NavigationContainerRefWithCurrent } from '@react-navigation/native'; // Import the hook
66
import { mocked } from 'jest-mock';
77
import waitForExpect from 'wait-for-expect';
@@ -458,10 +458,10 @@ describe('Instabug Module', () => {
458458
it('should call the native method setPrimaryColor on iOS', () => {
459459
Platform.OS = 'ios';
460460
const color = '#fff';
461-
Instabug.setPrimaryColor(color);
461+
Instabug.setTheme({ primaryColor: color });
462462

463-
expect(NativeInstabug.setPrimaryColor).toBeCalledTimes(1);
464-
expect(NativeInstabug.setPrimaryColor).toBeCalledWith(processColor(color));
463+
expect(NativeInstabug.setTheme).toBeCalledTimes(1);
464+
expect(NativeInstabug.setTheme).toBeCalledWith({ primaryColor: color });
465465
});
466466

467467
it('should call the native method appendTags', () => {

0 commit comments

Comments
 (0)