spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / diff / tests / pane-toggle / pane-toggle-of.test.ts
37 lines · 879 BRaw
1import { describe, expect, test, tier } from 'claude-code/testing'
2
3import Limits from '../../hooks/limits'
4import PaneToggle from '../../hooks/pane-toggle'
5
6tier('builtin')
7
8describe('pane-toggle-of', () => {
9 test('an open pane closes, however narrow', () => {
10 expect(
11 PaneToggle.paneToggleOf({
12 isOpen: true,
13 columns: Limits.OPEN_MIN_COLUMNS - 1,
14 }),
15 ).toBe('close')
16 })
17
18 test('below the panel width it is too narrow, from it it opens', () => {
19 expect(
20 PaneToggle.paneToggleOf({
21 isOpen: false,
22 columns: Limits.OPEN_MIN_COLUMNS - 1,
23 }),
24 ).toBe('too-narrow')
25
26 expect(
27 PaneToggle.paneToggleOf({
28 isOpen: false,
29 columns: Limits.OPEN_MIN_COLUMNS,
30 }),
31 ).toBe('open')
32
33 expect(PaneToggle.paneToggleOf({ isOpen: false, columns: null })).toBe(
34 'open',
35 )
36 })
37})