mirror of
https://github.com/samiyev/puaros.git
synced 2025-12-27 23:06:54 +05:00
Add DisplayConfigSchema with theme support (dark/light), stats/tool calls visibility toggles, bell notification on completion, and progress bar control. Includes theme utilities with dynamic color schemes and 46 new tests.
30 lines
790 B
TypeScript
30 lines
790 B
TypeScript
/**
|
|
* Tests for bell utility.
|
|
*/
|
|
|
|
import { describe, expect, it, vi } from "vitest"
|
|
import { ringBell } from "../../../../src/tui/utils/bell.js"
|
|
|
|
describe("ringBell", () => {
|
|
it("should write bell character to stdout", () => {
|
|
const writeSpy = vi.spyOn(process.stdout, "write").mockImplementation(() => true)
|
|
|
|
ringBell()
|
|
|
|
expect(writeSpy).toHaveBeenCalledWith("\u0007")
|
|
writeSpy.mockRestore()
|
|
})
|
|
|
|
it("should write correct ASCII bell character", () => {
|
|
const writeSpy = vi.spyOn(process.stdout, "write").mockImplementation(() => true)
|
|
|
|
ringBell()
|
|
|
|
const callArg = writeSpy.mock.calls[0]?.[0]
|
|
expect(callArg).toBe("\u0007")
|
|
expect(callArg?.charCodeAt(0)).toBe(7)
|
|
|
|
writeSpy.mockRestore()
|
|
})
|
|
})
|