feat(editor): eslint/tsconfig migration + type fixes
@robonen/editor: migrate to eslint flat config + composite tsconfig; fix convergence test type annotations.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { isInteractiveTarget } from '../view/interactive';
|
||||
|
||||
describe('isInteractiveTarget', () => {
|
||||
it('matches atom controls and contenteditable=false islands, not editor text', () => {
|
||||
const root = document.createElement('div');
|
||||
root.setAttribute('contenteditable', 'true');
|
||||
root.innerHTML = '<p class="text">hi</p><figure contenteditable="false"><input class="cap"></figure>';
|
||||
document.body.append(root);
|
||||
|
||||
expect(isInteractiveTarget(root.querySelector('input.cap'))).toBe(true);
|
||||
expect(isInteractiveTarget(root.querySelector('figure'))).toBe(true);
|
||||
expect(isInteractiveTarget(root.querySelector('p.text'))).toBe(false);
|
||||
expect(isInteractiveTarget(root)).toBe(false);
|
||||
expect(isInteractiveTarget(null)).toBe(false);
|
||||
|
||||
root.remove();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user