Skip to content

Commit 96c2652

Browse files
author
Test
committed
fix: update test assertions to match CSS variable refactor and fix rustfmt
1 parent 09674f9 commit 96c2652

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src-tauri/src/search.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,11 @@ fn replace_in_file_internal(
148148
let mut replaced_count = 0u32;
149149

150150
for (line_num, line_matches) in matches_by_line {
151-
let line_idx = if line_num > 0 { (line_num - 1) as usize } else { 0 };
151+
let line_idx = if line_num > 0 {
152+
(line_num - 1) as usize
153+
} else {
154+
0
155+
};
152156
if line_idx >= new_lines.len() {
153157
continue;
154158
}

src/components/cortex/primitives/__tests__/CortexHeaderItem.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe("CortexHeaderItem", () => {
5050
it("has secondary text color by default", () => {
5151
const { getByRole } = render(() => <CortexHeaderItem label="File" />);
5252
const button = getByRole("button") as HTMLElement;
53-
expect(button.style.color).toBe("rgb(140, 141, 143)");
53+
expect(button.style.color).toBe("var(--cortex-text-secondary)");
5454
});
5555

5656
it("has no border radius by default", () => {
@@ -74,7 +74,7 @@ describe("CortexHeaderItem", () => {
7474
<CortexHeaderItem label="File" isActive={true} />
7575
));
7676
const button = getByRole("button") as HTMLElement;
77-
expect(button.style.color).toBe("rgb(252, 252, 252)");
77+
expect(button.style.color).toBe("var(--cortex-text-primary)");
7878
});
7979

8080
it("has border radius when active", () => {
@@ -135,7 +135,7 @@ describe("CortexHeaderItem", () => {
135135
const button = getByRole("button") as HTMLElement;
136136
const mouseEnterEvent = new MouseEvent("mouseenter", { bubbles: true });
137137
button.dispatchEvent(mouseEnterEvent);
138-
expect(button.style.color).toBe("rgb(252, 252, 252)");
138+
expect(button.style.color).toBe("var(--cortex-text-primary)");
139139
});
140140

141141
it("applies border radius on hover", () => {
@@ -154,7 +154,7 @@ describe("CortexHeaderItem", () => {
154154
button.dispatchEvent(mouseEnterEvent);
155155
button.dispatchEvent(mouseLeaveEvent);
156156
expect(button.style.background).toBe("transparent");
157-
expect(button.style.color).toBe("rgb(140, 141, 143)");
157+
expect(button.style.color).toBe("var(--cortex-text-secondary)");
158158
expect(button.style.borderRadius).toBe("0px");
159159
});
160160
});

0 commit comments

Comments
 (0)