generated from nhcarrigan/template
chore: format
This commit is contained in:
@@ -1,9 +1,5 @@
|
|||||||
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
|
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
|
||||||
import {
|
import { NotificationType, NOTIFICATION_SOUNDS, type NotificationSound } from "./types";
|
||||||
NotificationType,
|
|
||||||
NOTIFICATION_SOUNDS,
|
|
||||||
type NotificationSound,
|
|
||||||
} from "./types";
|
|
||||||
|
|
||||||
// Mock HTMLAudioElement for soundPlayer tests
|
// Mock HTMLAudioElement for soundPlayer tests
|
||||||
class MockAudioElement {
|
class MockAudioElement {
|
||||||
|
|||||||
@@ -270,9 +270,7 @@ describe("conversation history formatting", () => {
|
|||||||
{ type: "user" as const, content: "How are you?" },
|
{ type: "user" as const, content: "How are you?" },
|
||||||
];
|
];
|
||||||
|
|
||||||
const relevantLines = lines.filter(
|
const relevantLines = lines.filter((line) => line.type === "user" || line.type === "assistant");
|
||||||
(line) => line.type === "user" || line.type === "assistant"
|
|
||||||
);
|
|
||||||
|
|
||||||
const history = relevantLines
|
const history = relevantLines
|
||||||
.map((line) => {
|
.map((line) => {
|
||||||
@@ -289,9 +287,7 @@ describe("conversation history formatting", () => {
|
|||||||
|
|
||||||
it("returns empty string for no messages", () => {
|
it("returns empty string for no messages", () => {
|
||||||
const lines: Array<{ type: string; content: string }> = [];
|
const lines: Array<{ type: string; content: string }> = [];
|
||||||
const relevantLines = lines.filter(
|
const relevantLines = lines.filter((line) => line.type === "user" || line.type === "assistant");
|
||||||
(line) => line.type === "user" || line.type === "assistant"
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(relevantLines.length).toBe(0);
|
expect(relevantLines.length).toBe(0);
|
||||||
const history = relevantLines.length === 0 ? "" : "has content";
|
const history = relevantLines.length === 0 ? "" : "has content";
|
||||||
|
|||||||
@@ -264,8 +264,7 @@ describe("quickActionsStore", () => {
|
|||||||
|
|
||||||
describe("quick action ID generation", () => {
|
describe("quick action ID generation", () => {
|
||||||
it("generates unique custom action IDs", () => {
|
it("generates unique custom action IDs", () => {
|
||||||
const generateId = () =>
|
const generateId = () => `custom-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
||||||
`custom-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
|
||||||
|
|
||||||
const id1 = generateId();
|
const id1 = generateId();
|
||||||
const id2 = generateId();
|
const id2 = generateId();
|
||||||
|
|||||||
@@ -289,8 +289,7 @@ describe("snippetsStore", () => {
|
|||||||
|
|
||||||
describe("snippet ID generation", () => {
|
describe("snippet ID generation", () => {
|
||||||
it("generates unique custom snippet IDs", () => {
|
it("generates unique custom snippet IDs", () => {
|
||||||
const generateId = () =>
|
const generateId = () => `custom-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
||||||
`custom-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
|
||||||
|
|
||||||
const id1 = generateId();
|
const id1 = generateId();
|
||||||
const id2 = generateId();
|
const id2 = generateId();
|
||||||
@@ -335,7 +334,7 @@ git push`,
|
|||||||
|
|
||||||
it("supports content with special characters", () => {
|
it("supports content with special characters", () => {
|
||||||
const snippet = {
|
const snippet = {
|
||||||
content: 'echo "Hello, World!" && echo \'Single quotes\'',
|
content: "echo \"Hello, World!\" && echo 'Single quotes'",
|
||||||
};
|
};
|
||||||
|
|
||||||
expect(snippet.content).toContain('"');
|
expect(snippet.content).toContain('"');
|
||||||
|
|||||||
Reference in New Issue
Block a user