|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
713 bytes
|
| Line | |
|---|
| 1 | /**
|
|---|
| 2 | * @flow
|
|---|
| 3 | */
|
|---|
| 4 |
|
|---|
| 5 | import type { JSXAttributeMockType } from './JSXAttributeMock';
|
|---|
| 6 |
|
|---|
| 7 | export type JSXElementMockType = {
|
|---|
| 8 | type: 'JSXElement',
|
|---|
| 9 | openingElement: {
|
|---|
| 10 | type: 'JSXOpeningElement',
|
|---|
| 11 | name: {
|
|---|
| 12 | type: 'JSXIdentifier',
|
|---|
| 13 | name: string,
|
|---|
| 14 | },
|
|---|
| 15 | attributes: Array<JSXAttributeMockType>,
|
|---|
| 16 | },
|
|---|
| 17 | children: Array<Node>,
|
|---|
| 18 | };
|
|---|
| 19 |
|
|---|
| 20 | export default function JSXElementMock(
|
|---|
| 21 | tagName: string,
|
|---|
| 22 | attributes: Array<JSXAttributeMockType> = [],
|
|---|
| 23 | children?: Array<Node> = [],
|
|---|
| 24 | ): JSXElementMockType {
|
|---|
| 25 | return {
|
|---|
| 26 | type: 'JSXElement',
|
|---|
| 27 | openingElement: {
|
|---|
| 28 | type: 'JSXOpeningElement',
|
|---|
| 29 | name: {
|
|---|
| 30 | type: 'JSXIdentifier',
|
|---|
| 31 | name: tagName,
|
|---|
| 32 | },
|
|---|
| 33 | attributes,
|
|---|
| 34 | },
|
|---|
| 35 | children,
|
|---|
| 36 | };
|
|---|
| 37 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.