Improve editor and cookie-consent test coverage, fix RegExp.exec lint

- Add 5 editor tests: toolbar mousedown, _sync, exec with/without value
- Mock document.execCommand for happy-dom compatibility
- Add cookie-consent test for duplicate script guard
- Use RegExp.exec() instead of String.match() per ESLint rule

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Serreau Jovann
2026-03-20 16:41:40 +01:00
parent acc9e2a5b8
commit d1e3de33df
3 changed files with 62 additions and 1 deletions

View File

@@ -2,7 +2,7 @@ const COOKIE_NAME = 'e_ticket_consent'
const COOKIE_DAYS = 365
function getCookie(name) {
const match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'))
const match = new RegExp('(^| )' + name + '=([^;]+)').exec(document.cookie)
return match ? match[2] : null
}