Add tests for editEvent, deleteEvent, toggles, and improve JS branch coverage
- Add 8 AccountController tests: editEvent GET/POST, access denied, delete, toggle online/secret, Stripe block - Add editor.js test for text/element node handling in sanitizeNode - Add cookie-consent test for banner without buttons (partial branch coverage) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -49,6 +49,13 @@ describe('initCookieConsent', () => {
|
||||
expect(banner.classList.contains('hidden')).toBe(true)
|
||||
})
|
||||
|
||||
it('handles banner without buttons', () => {
|
||||
document.body.innerHTML = '<div id="cookie-banner" class="hidden"></div>'
|
||||
initCookieConsent()
|
||||
const banner = document.getElementById('cookie-banner')
|
||||
expect(banner.classList.contains('hidden')).toBe(false)
|
||||
})
|
||||
|
||||
it('does nothing without banner element', () => {
|
||||
document.body.innerHTML = ''
|
||||
expect(() => initCookieConsent()).not.toThrow()
|
||||
|
||||
@@ -110,6 +110,14 @@ describe('ETicketEditor', () => {
|
||||
expect(event.defaultPrevented).toBe(true)
|
||||
})
|
||||
|
||||
it('sanitizeNode handles text nodes and element nodes', () => {
|
||||
const html = 'Hello <b>world</b> plain'
|
||||
const result = sanitizeHtml(html)
|
||||
expect(result).toContain('Hello')
|
||||
expect(result).toContain('<b>world</b>')
|
||||
expect(result).toContain('plain')
|
||||
})
|
||||
|
||||
it('allows non-tab keys', () => {
|
||||
const editor = createEditor()
|
||||
const content = editor.querySelector('.ete-content')
|
||||
|
||||
Reference in New Issue
Block a user