Skip to content

Commit da34f11

Browse files
committed
Fixed broken unit test
1 parent d06e100 commit da34f11

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/main/java/com/devoxx/genie/ui/panel/chatresponse/ResponseHeaderPanel.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import static com.devoxx.genie.chatmodel.ChatModelFactory.TEST_MODEL;
1919
import static com.devoxx.genie.ui.component.button.ButtonFactory.createActionButton;
2020
import static com.devoxx.genie.ui.util.DevoxxGenieIconsUtil.CopyIcon;
21-
import static com.intellij.notification.impl.ui.NotificationsUtil.getFontSize;
2221

2322
public class ResponseHeaderPanel extends JBPanel<ResponseHeaderPanel> {
2423

src/main/java/com/devoxx/genie/ui/util/FontUtil.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ public class FontUtil {
99
private FontUtil() {}
1010

1111
public static float getFontSize() {
12-
EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme();
12+
EditorColorsManager editorColorsManager = EditorColorsManager.getInstance();
13+
if (editorColorsManager == null) {
14+
// Default font size when running in test environment
15+
return JBUIScale.scale(12.0f);
16+
}
17+
18+
EditorColorsScheme scheme = editorColorsManager.getGlobalScheme();
1319
float fontSize = scheme.getEditorFontSize(); // returns int (size in points)
1420
float scaleFactor = JBUIScale.scale(1.0f); // returns scale-adjusted value
1521
return fontSize * scaleFactor;

0 commit comments

Comments
 (0)