feat(ui): add bug reporting integrations
This commit is contained in:
@@ -117,6 +117,65 @@ describe('uiFrontmatterSchema', () => {
|
||||
}
|
||||
expect(() => uiFrontmatterSchema.parse(data)).toThrow()
|
||||
})
|
||||
|
||||
it('accepts a bugReport block with bugpin and bugsink subconfigs', () => {
|
||||
const data = {
|
||||
pageTitle: 'Halfstreet',
|
||||
description: 'A gothic mystery.',
|
||||
footer: {
|
||||
copyright: '© 2026 Ethan J Lewis',
|
||||
links: [],
|
||||
},
|
||||
bugReport: {
|
||||
enabled: true,
|
||||
label: 'Report a Bug',
|
||||
bugpin: {
|
||||
serverUrl: 'https://bugpin.half.st',
|
||||
apiKey: 'proj_07df4bf91f12445b8ef8c723e865ed7b',
|
||||
},
|
||||
bugsink: {
|
||||
enabled: true,
|
||||
dsn: 'https://231ef18b6b4f426ca249778cfddf821c@bugsink.half.st/1',
|
||||
},
|
||||
},
|
||||
}
|
||||
expect(() => uiFrontmatterSchema.parse(data)).not.toThrow()
|
||||
})
|
||||
|
||||
it('accepts ui config with no bugReport block at all', () => {
|
||||
const data = {
|
||||
pageTitle: 'Halfstreet',
|
||||
description: 'A gothic mystery.',
|
||||
footer: { copyright: '© 2026 Ethan J Lewis', links: [] },
|
||||
}
|
||||
expect(() => uiFrontmatterSchema.parse(data)).not.toThrow()
|
||||
})
|
||||
|
||||
it('rejects a bugpin block with a non-url serverUrl', () => {
|
||||
const data = {
|
||||
pageTitle: 'Halfstreet',
|
||||
description: 'A gothic mystery.',
|
||||
footer: { copyright: '© 2026 Ethan J Lewis', links: [] },
|
||||
bugReport: {
|
||||
enabled: true,
|
||||
bugpin: { serverUrl: 'not-a-url', apiKey: 'proj_x' },
|
||||
},
|
||||
}
|
||||
expect(() => uiFrontmatterSchema.parse(data)).toThrow()
|
||||
})
|
||||
|
||||
it('rejects a bugsink block with a non-url dsn', () => {
|
||||
const data = {
|
||||
pageTitle: 'Halfstreet',
|
||||
description: 'A gothic mystery.',
|
||||
footer: { copyright: '© 2026 Ethan J Lewis', links: [] },
|
||||
bugReport: {
|
||||
enabled: true,
|
||||
bugsink: { dsn: 'whatever' },
|
||||
},
|
||||
}
|
||||
expect(() => uiFrontmatterSchema.parse(data)).toThrow()
|
||||
})
|
||||
})
|
||||
|
||||
describe('lightMechanicFrontmatterSchema', () => {
|
||||
|
||||
Reference in New Issue
Block a user