fix: fix test

This commit is contained in:
haiqin 2024-01-02 15:35:19 +08:00
parent 444b73f7ec
commit f4d21f69a4
1 changed files with 1 additions and 8 deletions

View File

@ -55,13 +55,6 @@ describe('SuspenseComponent Test', () => {
});
it('suspense fallback can be updated', async () => {
// 用同步的代码来实现异步操作
class LazyComponent extends Inula.Component {
render() {
return <Text text={this.props.num} />;
}
}
const Lazy = Inula.lazy(() => {
// wait for 3s
return new Promise(resolve => setTimeout(resolve({ default: LazyComponent }), 3000));
@ -76,7 +69,7 @@ describe('SuspenseComponent Test', () => {
const container = document.createElement('div');
Inula.render(
<Inula.Suspense fallback={<Fallback />}>
<Lazy num={5} />
<Lazy />
</Inula.Suspense>,
container
);