mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-06 05:49:32 +08:00
31 lines
660 B
TypeScript
31 lines
660 B
TypeScript
|
import {render} from 'react-testing-library';
|
||
|
import {render as amisRender} from '../../src';
|
||
|
import {makeEnv} from '../helper';
|
||
|
|
||
|
beforeAll(() => {
|
||
|
// jsdom not implemented: HTMLMediaElement.prototype.load
|
||
|
// here: https://github.com/jsdom/jsdom/issues/1515
|
||
|
Object.defineProperty(global.window.HTMLMediaElement.prototype, 'load', {
|
||
|
get() {
|
||
|
return () => {}
|
||
|
}
|
||
|
})
|
||
|
});
|
||
|
|
||
|
test('Renderer:alert', () => {
|
||
|
const {container} = render(amisRender(
|
||
|
{
|
||
|
type: 'audio',
|
||
|
src: '${url}'
|
||
|
},
|
||
|
{
|
||
|
data: {
|
||
|
url: 'https://example.com/music.mp3'
|
||
|
}
|
||
|
},
|
||
|
makeEnv({})
|
||
|
));
|
||
|
|
||
|
expect(container).toMatchSnapshot();
|
||
|
});
|