lijianan
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
1 deletions
-
components/locale-provider/__tests__/cached-context.test.tsx
|
|
@ -28,11 +28,13 @@ const CacheOuter: React.FC = memo(() => ( |
|
|
|
</LocaleProvider> |
|
|
|
</> |
|
|
|
)); |
|
|
|
|
|
|
|
it("Rendering on LocaleProvider won't trigger rendering on child component.", () => { |
|
|
|
const { container } = pureRender(<CacheOuter />); |
|
|
|
const { container, unmount } = pureRender(<CacheOuter />); |
|
|
|
expect(outerCount).toBe(0); |
|
|
|
expect(innerCount).toBe(1); |
|
|
|
fireEvent.click(container.querySelector('#parent_btn')!); |
|
|
|
expect(outerCount).toBe(1); |
|
|
|
expect(innerCount).toBe(1); |
|
|
|
unmount(); |
|
|
|
}); |
|
|
|