* hardening: isolate third-party paths and clean external-build metadata * fix: restore external feedback flow and make privacy check portable
24 lines
700 B
TypeScript
24 lines
700 B
TypeScript
import { expect, test } from 'bun:test'
|
|
|
|
import { createGitHubIssueUrl } from './Feedback.tsx'
|
|
|
|
(globalThis as { MACRO?: { VERSION?: string } }).MACRO = { VERSION: '0.1.7' }
|
|
|
|
test('createGitHubIssueUrl omits empty feedback IDs', () => {
|
|
const url = decodeURIComponent(
|
|
createGitHubIssueUrl('', 'Bug title', 'Bug description', []),
|
|
)
|
|
|
|
expect(url).not.toContain('Feedback ID:')
|
|
expect(url).toContain('Bug Description')
|
|
expect(url).toContain('Errors')
|
|
})
|
|
|
|
test('createGitHubIssueUrl includes feedback IDs when present', () => {
|
|
const url = decodeURIComponent(
|
|
createGitHubIssueUrl('fb-123', 'Bug title', 'Bug description', []),
|
|
)
|
|
|
|
expect(url).toContain('Feedback ID: fb-123')
|
|
})
|