|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 2 weeks ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
675 bytes
|
| Line | |
|---|
| 1 | import test from 'tape';
|
|---|
| 2 | import { dom } from 'aria-query';
|
|---|
| 3 | import { elementType } from 'jsx-ast-utils';
|
|---|
| 4 |
|
|---|
| 5 | import isDOMElement from '../../../src/util/isDOMElement';
|
|---|
| 6 | import JSXElementMock from '../../../__mocks__/JSXElementMock';
|
|---|
| 7 |
|
|---|
| 8 | test('isDOMElement', (t) => {
|
|---|
| 9 | t.test('DOM elements', (st) => {
|
|---|
| 10 | dom.forEach((_, el) => {
|
|---|
| 11 | const element = JSXElementMock(el);
|
|---|
| 12 |
|
|---|
| 13 | st.equal(
|
|---|
| 14 | isDOMElement(elementType(element.openingElement)),
|
|---|
| 15 | true,
|
|---|
| 16 | `identifies ${el} as a DOM element`,
|
|---|
| 17 | );
|
|---|
| 18 | });
|
|---|
| 19 |
|
|---|
| 20 | st.end();
|
|---|
| 21 | });
|
|---|
| 22 |
|
|---|
| 23 | t.equal(
|
|---|
| 24 | isDOMElement(JSXElementMock('CustomElement')),
|
|---|
| 25 | false,
|
|---|
| 26 | 'does not identify a custom element',
|
|---|
| 27 | );
|
|---|
| 28 |
|
|---|
| 29 | t.end();
|
|---|
| 30 | });
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.