checkpoint: pre-split branch cleanup

This commit is contained in:
ZenchantLive 2026-03-03 16:43:42 -08:00
parent 4c2ae2e5b7
commit b5db7a7753
276 changed files with 35912 additions and 60119 deletions

View file

@ -0,0 +1,84 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { shouldHideEpicEntry, type LeftPanelFilters } from '../../../src/components/shared/left-panel';
const defaultFilters: LeftPanelFilters = {
query: '',
status: 'all',
priority: 'all',
preset: 'all',
hideClosed: true,
};
test('does not hide epics with no children when hideClosed is the only active toggle', () => {
const hidden = shouldHideEpicEntry({
epicStatus: 'open',
matchedChildrenCount: 0,
totalChildrenCount: 0,
isSelected: false,
filters: defaultFilters,
});
assert.equal(hidden, false);
});
test('hides epics with only closed children when hideClosed is enabled', () => {
const hidden = shouldHideEpicEntry({
epicStatus: 'open',
matchedChildrenCount: 0,
totalChildrenCount: 4,
isSelected: false,
filters: defaultFilters,
});
assert.equal(hidden, true);
});
test('hides epic with children when query filter excludes all children', () => {
const hidden = shouldHideEpicEntry({
epicStatus: 'open',
matchedChildrenCount: 0,
totalChildrenCount: 3,
isSelected: false,
filters: { ...defaultFilters, query: 'nonexistent' },
});
assert.equal(hidden, true);
});
test('keeps selected epic visible even when no children match filters', () => {
const hidden = shouldHideEpicEntry({
epicStatus: 'open',
matchedChildrenCount: 0,
totalChildrenCount: 5,
isSelected: true,
filters: { ...defaultFilters, status: 'blocked' },
});
assert.equal(hidden, false);
});
test('hides closed epic even when it has no children', () => {
const hidden = shouldHideEpicEntry({
epicStatus: 'closed',
matchedChildrenCount: 0,
totalChildrenCount: 0,
isSelected: false,
filters: defaultFilters,
});
assert.equal(hidden, true);
});
test('hides closed selected epic when hideClosed is enabled', () => {
const hidden = shouldHideEpicEntry({
epicStatus: 'closed',
matchedChildrenCount: 2,
totalChildrenCount: 2,
isSelected: true,
filters: defaultFilters,
});
assert.equal(hidden, true);
});

View file

@ -1,66 +1,66 @@
import { describe, it } from 'node:test';
import assert from 'node:assert';
describe('LeftPanel Component Contract', () => {
it('exports LeftPanel component', async () => {
try {
const mod = await import('../../../src/components/shared/left-panel');
assert.ok(mod.LeftPanel, 'LeftPanel should be exported');
assert.equal(typeof mod.LeftPanel, 'function', 'LeftPanel should be a function/component');
} catch (err: any) {
assert.fail(`LeftPanel module should exist: ${err.message}`);
}
});
it('LeftPanel accepts issues and onEpicSelect props', async () => {
try {
const mod = await import('../../../src/components/shared/left-panel');
const LeftPanel = mod.LeftPanel;
assert.ok(LeftPanel, 'Component should be callable');
} catch (err: any) {
assert.fail(`Component import failed: ${err.message}`);
}
});
});
describe('LeftPanel Tree Structure', () => {
it('renders epics as expandable tree items', async () => {
try {
const mod = await import('../../../src/components/shared/left-panel');
assert.ok(mod.LeftPanel, 'LeftPanel should exist');
} catch (err: any) {
assert.fail(`LeftPanel should render epic tree: ${err.message}`);
}
});
it('groups beads under their parent epic', async () => {
try {
const mod = await import('../../../src/components/shared/left-panel');
assert.ok(mod.LeftPanel, 'LeftPanel should exist');
} catch (err: any) {
assert.fail(`LeftPanel should group beads under epics: ${err.message}`);
}
});
});
describe('LeftPanel Responsive Behavior', () => {
it('applies responsive classes for desktop, tablet, and mobile', async () => {
try {
const mod = await import('../../../src/components/shared/left-panel');
assert.ok(mod.LeftPanel, 'LeftPanel should exist');
} catch (err: any) {
assert.fail(`LeftPanel should have responsive classes: ${err.message}`);
}
});
});
describe('LeftPanel Scope Controls', () => {
it('renders scope section', async () => {
try {
const mod = await import('../../../src/components/shared/left-panel');
assert.ok(mod.LeftPanel, 'LeftPanel should exist');
} catch (err: any) {
assert.fail(`LeftPanel should render scope section: ${err.message}`);
}
});
});
import { describe, it } from 'node:test';
import assert from 'node:assert';
describe('LeftPanel Component Contract', () => {
it('exports LeftPanel component', async () => {
try {
const mod = await import('../../../src/components/shared/left-panel');
assert.ok(mod.LeftPanel, 'LeftPanel should be exported');
assert.equal(typeof mod.LeftPanel, 'function', 'LeftPanel should be a function/component');
} catch (err: any) {
assert.fail(`LeftPanel module should exist: ${err.message}`);
}
});
it('LeftPanel accepts issues and onEpicSelect props', async () => {
try {
const mod = await import('../../../src/components/shared/left-panel');
const LeftPanel = mod.LeftPanel;
assert.ok(LeftPanel, 'Component should be callable');
} catch (err: any) {
assert.fail(`Component import failed: ${err.message}`);
}
});
});
describe('LeftPanel Tree Structure', () => {
it('renders epics as expandable tree items', async () => {
try {
const mod = await import('../../../src/components/shared/left-panel');
assert.ok(mod.LeftPanel, 'LeftPanel should exist');
} catch (err: any) {
assert.fail(`LeftPanel should render epic tree: ${err.message}`);
}
});
it('groups beads under their parent epic', async () => {
try {
const mod = await import('../../../src/components/shared/left-panel');
assert.ok(mod.LeftPanel, 'LeftPanel should exist');
} catch (err: any) {
assert.fail(`LeftPanel should group beads under epics: ${err.message}`);
}
});
});
describe('LeftPanel Responsive Behavior', () => {
it('applies responsive classes for desktop, tablet, and mobile', async () => {
try {
const mod = await import('../../../src/components/shared/left-panel');
assert.ok(mod.LeftPanel, 'LeftPanel should exist');
} catch (err: any) {
assert.fail(`LeftPanel should have responsive classes: ${err.message}`);
}
});
});
describe('LeftPanel Scope Controls', () => {
it('renders scope section', async () => {
try {
const mod = await import('../../../src/components/shared/left-panel');
assert.ok(mod.LeftPanel, 'LeftPanel should exist');
} catch (err: any) {
assert.fail(`LeftPanel should render scope section: ${err.message}`);
}
});
});

View file

@ -0,0 +1,11 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import fs from 'node:fs/promises';
import path from 'node:path';
test('UnifiedShell clears selected closed epic when hideClosed is enabled', async () => {
const file = await fs.readFile(path.join(process.cwd(), 'src/components/shared/unified-shell.tsx'), 'utf8');
assert.ok(file.includes('if (epic.status === \'closed\' || epic.status === \'tombstone\')'), 'expected closed epic guard');
assert.ok(file.includes('setEpicId(null);'), 'expected selected epic reset');
});