From bfb2b8e6591891b529d5cf0f8757ff8b7080e004 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Mon, 17 Apr 2023 11:22:40 -0400 Subject: [PATCH] fix: change class name behaviour to limit snapshot diffs Signed-off-by: Sebastian Malton --- .../__snapshots__/status-bar.test.tsx.snap | 18 +++++++++--------- .../status-bar/status-bar.module.scss | 5 +---- .../components/status-bar/status-bar.test.tsx | 3 +-- .../components/status-bar/status-bar.tsx | 6 +++++- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/core/src/renderer/components/status-bar/__snapshots__/status-bar.test.tsx.snap b/packages/core/src/renderer/components/status-bar/__snapshots__/status-bar.test.tsx.snap index 8931fed442..c244b6ccf0 100644 --- a/packages/core/src/renderer/components/status-bar/__snapshots__/status-bar.test.tsx.snap +++ b/packages/core/src/renderer/components/status-bar/__snapshots__/status-bar.test.tsx.snap @@ -838,7 +838,7 @@ exports[` when an extension is enabled specifying the side the elem
when an extension is enabled with an invalid data type, (
when an extension is enabled with an invalid data type, (
when an extension is enabled with an invalid data type, (
when an extension is enabled with an invalid data type, (
when an extension is enabled with an invalid data type, (
when an extension is enabled with an invalid data type, (
when an extension is enabled with an invalid data type, (
when an extension is enabled with no status items renders
", () => { }); it("has the default status by default", () => { - expect([...result.getByTestId("status-bar").classList]).toContain("status-default"); + expect([...result.getByTestId("status-bar").classList]).toEqual(["StatusBar"]); }); describe.each([ diff --git a/packages/core/src/renderer/components/status-bar/status-bar.tsx b/packages/core/src/renderer/components/status-bar/status-bar.tsx index f926c83d2e..4ccd445245 100644 --- a/packages/core/src/renderer/components/status-bar/status-bar.tsx +++ b/packages/core/src/renderer/components/status-bar/status-bar.tsx @@ -27,9 +27,13 @@ const NonInjectedStatusBar = observer(({ status, }: Dependencies & StatusBarProps) => { const { left, right } = items.get(); + const barStatus = status.get(); + const barStyle = barStatus === "default" + ? undefined + : styles[`status-${barStatus}`]; return ( -
+
{left.map((Item, index) => (