2022-02-10 20:15:39 +08:00
|
|
|
import React = require('react');
|
2023-07-18 12:24:45 +08:00
|
|
|
import {render, waitFor} from '@testing-library/react';
|
2022-06-02 10:00:09 +08:00
|
|
|
import '../../src';
|
|
|
|
import {render as amisRender} from '../../src';
|
2023-07-18 12:24:45 +08:00
|
|
|
import {makeEnv, wait} from '../helper';
|
2022-02-10 20:15:39 +08:00
|
|
|
|
2023-07-18 12:24:45 +08:00
|
|
|
test('Renderer:json', async () => {
|
2022-02-10 20:15:39 +08:00
|
|
|
const {container} = render(
|
|
|
|
amisRender(
|
|
|
|
{
|
|
|
|
type: 'page',
|
|
|
|
body: {
|
|
|
|
type: 'json',
|
|
|
|
value: {
|
|
|
|
a: 'a',
|
|
|
|
b: 'b',
|
|
|
|
c: {
|
|
|
|
d: 'd'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{},
|
|
|
|
makeEnv({})
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2023-07-18 12:24:45 +08:00
|
|
|
await wait(1000);
|
2022-02-10 20:15:39 +08:00
|
|
|
expect(container).toMatchSnapshot();
|
|
|
|
});
|