test: add component logic tests and clean up eslint directives
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 56s
CI / Lint & Test (pull_request) Successful in 16m12s
CI / Build Linux (pull_request) Successful in 20m14s
CI / Build Windows (cross-compile) (pull_request) Successful in 32m19s

Adds mirror-function tests for five Svelte components (HighlightedText,
CliVersion, AchievementNotification, StatusBar, ConversationTabs) and
removes stale eslint-disable comments from existing store test files.
This commit is contained in:
2026-03-03 12:21:47 -08:00
committed by Naomi Carrigan
parent fd3122e080
commit 514e137590
9 changed files with 693 additions and 5 deletions
+11 -2
View File
@@ -1,4 +1,3 @@
/* eslint-disable max-lines-per-function -- Test suites naturally have many cases */
import { describe, it, expect, beforeEach, vi, afterEach } from "vitest";
import { get } from "svelte/store";
import { characterState, characterInfo } from "./character";
@@ -26,7 +25,17 @@ describe("characterState store", () => {
});
it("can set any valid state", () => {
const states = ["idle", "thinking", "typing", "coding", "searching", "mcp", "permission", "success", "error"] as const;
const states = [
"idle",
"thinking",
"typing",
"coding",
"searching",
"mcp",
"permission",
"success",
"error",
] as const;
for (const state of states) {
characterState.setState(state);
expect(get(characterState)).toBe(state);
-1
View File
@@ -1,4 +1,3 @@
/* eslint-disable max-lines-per-function -- Test suites naturally have many cases */
import { describe, it, expect } from "vitest";
import {
formatCost,
-1
View File
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/init-declarations -- Variables reassigned in beforeEach */
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
import { writable } from "svelte/store";
-1
View File
@@ -1,4 +1,3 @@
/* eslint-disable max-lines-per-function -- Test suites naturally have many cases */
import { describe, it, expect, beforeEach } from "vitest";
import { get } from "svelte/store";
import { searchState, isSearchActive, searchQuery } from "./search";