Skip to content
Permalink
9bfb9ba527
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Latest commit 0a11e3f Jan 18, 2023 History
0 contributors

Users who have contributed to this file

26 lines (24 sloc) 811 Bytes
import expect from 'expect';
import { dom } from 'aria-query';
import { elementType } from 'jsx-ast-utils';
import isDOMElement from '../../../src/util/isDOMElement';
import JSXElementMock from '../../../__mocks__/JSXElementMock';
const domElements = [...dom.keys()];
describe('isDOMElement', () => {
describe('DOM elements', () => {
domElements.forEach((el) => {
it(`should identify ${el} as a DOM element`, () => {
const element = JSXElementMock(el);
expect(isDOMElement(elementType(element.openingElement)))
.toBe(true);
});
});
});
describe('Custom Element', () => {
it('should not identify a custom element', () => {
const element = JSXElementMock('CustomElement');
expect(isDOMElement(element))
.toBe(false);
});
});
});