Skip to content

Commit d17f136

Browse files
committed
fix: unit test
1 parent a73e2ee commit d17f136

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
@@ -704,25 +704,21 @@ public void testSetThemeWithAllProperties() {
704704
when(mock.build()).thenReturn(mock(com.instabug.library.model.IBGTheme.class));
705705
});
706706

707-
api.setTheme(themeConfig);
708-
709-
com.instabug.library.model.IBGTheme.Builder builder = mThemeBuilder.constructed().get(0);
710-
711-
// Verify color setters were called
712-
verify(builder).setPrimaryColor(android.graphics.Color.parseColor("#FF6B6B"));
713-
verify(builder).setBackgroundColor(android.graphics.Color.parseColor("#FFFFFF"));
714-
verify(builder).setTitleTextColor(android.graphics.Color.parseColor("#000000"));
715-
verify(builder).setPrimaryTextColor(android.graphics.Color.parseColor("#333333"));
716-
verify(builder).setSecondaryTextColor(android.graphics.Color.parseColor("#666666"));
717-
718-
// Verify text style setters were called
719-
verify(builder).setPrimaryTextStyle(Typeface.BOLD);
720-
verify(builder).setSecondaryTextStyle(Typeface.ITALIC);
721-
verify(builder).setCtaTextStyle(Typeface.BOLD_ITALIC);
722-
723-
// Verify theme was set on Instabug
724-
mInstabug.verify(() -> Instabug.setTheme(any(com.instabug.library.model.IBGTheme.class)));
725-
707+
api.setTheme(themeConfig);
708+
709+
com.instabug.library.model.IBGTheme.Builder builder = mThemeBuilder.constructed().get(0);
710+
711+
verify(builder).setPrimaryColor(anyInt());
712+
verify(builder).setBackgroundColor(anyInt());
713+
verify(builder).setTitleTextColor(anyInt());
714+
verify(builder).setPrimaryTextColor(anyInt());
715+
verify(builder).setSecondaryTextColor(anyInt());
716+
717+
verify(builder).setPrimaryTextStyle(Typeface.BOLD);
718+
verify(builder).setSecondaryTextStyle(Typeface.ITALIC);
719+
verify(builder).setCtaTextStyle(Typeface.BOLD_ITALIC);
720+
721+
mInstabug.verify(() -> Instabug.setTheme(any(com.instabug.library.model.IBGTheme.class)))
726722
}
727723

728724

0 commit comments

Comments
 (0)