Skip to content

Commit

Permalink
remove unused Promise.resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Dec 19, 2024
1 parent d8d6558 commit 9251faa
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 32 deletions.
40 changes: 16 additions & 24 deletions tests/react/utils/useHydrateAtoms.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,10 @@ it('useHydrateAtoms should only hydrate on first render', async () => {
</>
)
}
const { rerender } = await Promise.resolve(
render(
<StrictMode>
<Counter initialCount={42} initialStatus="rejected" />
</StrictMode>,
),
const { rerender } = render(
<StrictMode>
<Counter initialCount={42} initialStatus="rejected" />
</StrictMode>,
)

await screen.findByText('count: 42')
Expand Down Expand Up @@ -106,12 +104,10 @@ it('useHydrateAtoms should only hydrate on first render using a Map', async () =
)
}

const { rerender } = await Promise.resolve(
render(
<StrictMode>
<Counter initialCount={42} />
</StrictMode>,
),
const { rerender } = render(
<StrictMode>
<Counter initialCount={42} />
</StrictMode>,
)

await screen.findByText('count: 42')
Expand Down Expand Up @@ -213,12 +209,10 @@ it('useHydrateAtoms can only restore an atom once', async () => {
)
}

const { rerender } = await Promise.resolve(
render(
<StrictMode>
<Counter initialCount={42} />
</StrictMode>,
),
const { rerender } = render(
<StrictMode>
<Counter initialCount={42} />
</StrictMode>,
)

await screen.findByText('count: 42')
Expand Down Expand Up @@ -301,12 +295,10 @@ it('passing dangerouslyForceHydrate to useHydrateAtoms will re-hydrated atoms',
)
}

const { rerender } = await Promise.resolve(
render(
<StrictMode>
<Counter initialCount={42} initialStatus="rejected" />
</StrictMode>,
),
const { rerender } = render(
<StrictMode>
<Counter initialCount={42} initialStatus="rejected" />
</StrictMode>,
)

await screen.findByText('count: 42')
Expand Down
14 changes: 6 additions & 8 deletions tests/react/vanilla-utils/loadable.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,12 @@ it('loadable can use resolved promises synchronously', async () => {
return <div>Ready</div>
}

const { rerender } = await Promise.resolve(
render(
<StrictMode>
<Suspense fallback="loading">
<ResolveAtomComponent />
</Suspense>
</StrictMode>,
),
const { rerender } = render(
<StrictMode>
<Suspense fallback="loading">
<ResolveAtomComponent />
</Suspense>
</StrictMode>,
)

if (IS_REACT18 || IS_REACT19) {
Expand Down

0 comments on commit 9251faa

Please sign in to comment.