generated from nhcarrigan/template
test: add component logic tests and clean up eslint directives
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:
@@ -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,4 +1,3 @@
|
||||
/* eslint-disable max-lines-per-function -- Test suites naturally have many cases */
|
||||
import { describe, it, expect } from "vitest";
|
||||
import {
|
||||
formatCost,
|
||||
|
||||
@@ -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,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";
|
||||
|
||||
Reference in New Issue
Block a user