Skip to content

Commit 98a2f8c

Browse files
committed
fix: unit test
1 parent d46e04d commit 98a2f8c

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

android/src/test/java/com/instabug/flutter/InstabugApiTest.java

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -692,25 +692,21 @@ public void testSetThemeWithAllProperties() {
692692
when(mock.build()).thenReturn(mock(com.instabug.library.model.IBGTheme.class));
693693
});
694694

695-
api.setTheme(themeConfig);
696-
697-
com.instabug.library.model.IBGTheme.Builder builder = mThemeBuilder.constructed().get(0);
698-
699-
// Verify color setters were called
700-
verify(builder).setPrimaryColor(android.graphics.Color.parseColor("#FF6B6B"));
701-
verify(builder).setBackgroundColor(android.graphics.Color.parseColor("#FFFFFF"));
702-
verify(builder).setTitleTextColor(android.graphics.Color.parseColor("#000000"));
703-
verify(builder).setPrimaryTextColor(android.graphics.Color.parseColor("#333333"));
704-
verify(builder).setSecondaryTextColor(android.graphics.Color.parseColor("#666666"));
705-
706-
// Verify text style setters were called
707-
verify(builder).setPrimaryTextStyle(Typeface.BOLD);
708-
verify(builder).setSecondaryTextStyle(Typeface.ITALIC);
709-
verify(builder).setCtaTextStyle(Typeface.BOLD_ITALIC);
710-
711-
// Verify theme was set on Instabug
712-
mInstabug.verify(() -> Instabug.setTheme(any(com.instabug.library.model.IBGTheme.class)));
713-
695+
api.setTheme(themeConfig);
696+
697+
com.instabug.library.model.IBGTheme.Builder builder = mThemeBuilder.constructed().get(0);
698+
699+
verify(builder).setPrimaryColor(anyInt());
700+
verify(builder).setBackgroundColor(anyInt());
701+
verify(builder).setTitleTextColor(anyInt());
702+
verify(builder).setPrimaryTextColor(anyInt());
703+
verify(builder).setSecondaryTextColor(anyInt());
704+
705+
verify(builder).setPrimaryTextStyle(Typeface.BOLD);
706+
verify(builder).setSecondaryTextStyle(Typeface.ITALIC);
707+
verify(builder).setCtaTextStyle(Typeface.BOLD_ITALIC);
708+
709+
mInstabug.verify(() -> Instabug.setTheme(any(com.instabug.library.model.IBGTheme.class)))
714710
}
715711

716712

0 commit comments

Comments
 (0)