diff --git a/test/trace-position.test.ts b/test/trace-position.test.ts new file mode 100644 index 0000000..ecc3890 --- /dev/null +++ b/test/trace-position.test.ts @@ -0,0 +1,13 @@ +import { describe, expect, it } from 'vitest' +import { hasTracePosition } from '../ui/src/tracePosition' + +describe('hasTracePosition', () => { + it('accepts zero as a valid trace position', () => { + expect(hasTracePosition('src/index.ts', 0)).toBe(true) + }) + + it('rejects missing paths and positions', () => { + expect(hasTracePosition(undefined, 0)).toBe(false) + expect(hasTracePosition('src/index.ts', undefined)).toBe(false) + }) +}) diff --git a/ui/components/TreeNode.vue b/ui/components/TreeNode.vue index 997a094..bfe77f0 100644 --- a/ui/components/TreeNode.vue +++ b/ui/components/TreeNode.vue @@ -1,6 +1,7 @@