chore(tests): remove imperfectly working test added in #276 (#1184)

* used createRoot in test

* Removed unused test
This commit is contained in:
Łukasz Rabiec 2022-08-17 15:56:23 +02:00 committed by GitHub
parent af607edf9a
commit 75d0886cd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,7 +5,7 @@ import {
useLayoutEffect,
useState,
} from 'react'
import { act, fireEvent, render, waitFor } from '@testing-library/react'
import { act, fireEvent, render } from '@testing-library/react'
import ReactDOM from 'react-dom'
import create, { StoreApi } from 'zustand'
@ -143,25 +143,6 @@ it('only re-renders if selected state has changed', async () => {
expect(controlRenderCount).toBe(1)
})
it('re-renders with useLayoutEffect', async () => {
const useBoundStore = create(() => ({ state: false }))
function Component() {
const { state } = useBoundStore()
useLayoutEffect(() => {
useBoundStore.setState({ state: true })
}, [])
return <>{`${state}`}</>
}
const container = document.createElement('div')
ReactDOM.render(<Component />, container)
await waitFor(() => {
expect(container.innerHTML).toBe('true')
})
ReactDOM.unmountComponentAtNode(container)
})
it('can batch updates', async () => {
const useBoundStore = create<CounterState>((set) => ({
count: 0,