codeburn/app/scripts/buildStamp.test.ts
iamtoruk 0a76626d21 fix(app): clean build stamp, splash without hash, About checks for updates
- build stamp ignores the pricing-snapshot files the build regenerates,
  so a release checkout no longer shows a false -dirty
- splash shows just the flame, CodeBurn, and the version (dropped the
  commit-hash line); the clean build id stays in About only
- About 'Check for updates' uses the in-app checker and reports inline
  ('You're on the latest' / 'Update available: X · Download') instead
  of blindly opening the releases page

392/392.
2026-07-17 14:30:00 -07:00

36 lines
1.3 KiB
TypeScript

import { describe, expect, it } from 'vitest'
import { GENERATED_DATA_FILES, isDirtyIgnoringGenerated } from './buildStamp'
describe('isDirtyIgnoringGenerated', () => {
it('reads clean on an empty status', () => {
expect(isDirtyIgnoringGenerated('')).toBe(false)
expect(isDirtyIgnoringGenerated('\n')).toBe(false)
})
it('reads clean when only the regenerated pricing snapshots differ', () => {
const porcelain = GENERATED_DATA_FILES.map(f => ` M ${f}`).join('\n')
expect(isDirtyIgnoringGenerated(porcelain)).toBe(false)
})
it('reads clean for a single regenerated data file', () => {
expect(isDirtyIgnoringGenerated(' M src/data/litellm-snapshot.json')).toBe(false)
})
it('reads dirty when a source file also differs', () => {
const porcelain = ' M src/data/litellm-snapshot.json\n M app/renderer/components/AboutModal.tsx'
expect(isDirtyIgnoringGenerated(porcelain)).toBe(true)
})
it('reads dirty for a staged source change', () => {
expect(isDirtyIgnoringGenerated('M src/cli.ts')).toBe(true)
})
it('reads dirty for an untracked file', () => {
expect(isDirtyIgnoringGenerated('?? some-new-file.ts')).toBe(true)
})
it('counts a rename by its destination path', () => {
expect(isDirtyIgnoringGenerated('R old/path.ts -> src/data/other.ts')).toBe(true)
})
})