test(frontend): add Vitest unit-test harness with first brand helper
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
export function brandTitle(name) {
|
||||
const trimmed = (name || '').trim()
|
||||
return trimmed || 'RFC'
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import { brandTitle } from './brand.js'
|
||||
|
||||
describe('brandTitle', () => {
|
||||
it('returns the deployment name when set', () => {
|
||||
expect(brandTitle('Wiggleverse')).toBe('Wiggleverse')
|
||||
})
|
||||
|
||||
it('falls back to a neutral placeholder when name is empty', () => {
|
||||
expect(brandTitle('')).toBe('RFC')
|
||||
expect(brandTitle(undefined)).toBe('RFC')
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1 @@
|
||||
import '@testing-library/jest-dom'
|
||||
Reference in New Issue
Block a user