lib/clipboard.ts exists specifically to fix issue #145 ("Copy" buttons silently failing over plain HTTP where navigator.clipboard is undefined) by falling back to a hidden-textarea + document.execCommand('copy') trick. Despite being the actual fix for a real, previously-reported bug, there's no lib/clipboard.test.ts exercising either path — the preferred navigator.clipboard.writeText branch, the fallback textarea branch, or the "every strategy failed" false-return branch. Since jsdom (already a devDependency, used for the rest of the component test suite) supports mocking both navigator.clipboard and document.execCommand, this is straightforward to cover and would catch any future regression in the exact bug this file was written to prevent.
lib/clipboard.tsexists specifically to fix issue #145 ("Copy" buttons silently failing over plain HTTP wherenavigator.clipboardis undefined) by falling back to a hidden-textarea +document.execCommand('copy')trick. Despite being the actual fix for a real, previously-reported bug, there's nolib/clipboard.test.tsexercising either path — the preferrednavigator.clipboard.writeTextbranch, the fallback textarea branch, or the "every strategy failed"false-return branch. Sincejsdom(already a devDependency, used for the rest of the component test suite) supports mocking bothnavigator.clipboardanddocument.execCommand, this is straightforward to cover and would catch any future regression in the exact bug this file was written to prevent.