Skip to content

Commit

Permalink
chore: remove "act" as we do not have any reason to use it anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker committed Nov 23, 2021
1 parent 0b49c45 commit 3081557
Showing 1 changed file with 8 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/

import React from 'react'
import { act } from '@testing-library/react'
import {
mount,
fakeProps,
Expand Down Expand Up @@ -375,13 +374,11 @@ describe('Infinity scroller', () => {
const items = Object.values(localStack.current)

const action = ({ pageNumber }) => {
act(() => {
setCurrentPage(pageNumber)
setCurrentPage(pageNumber)

if (pageNumber === 1) {
endInfinity()
}
})
if (pageNumber === 1) {
endInfinity()
}
}

return (
Expand Down Expand Up @@ -499,11 +496,7 @@ describe('Infinity scroller', () => {
const clickOnLoadMore = async () => {
Comp.find('div.dnb-pagination__loadbar button').simulate('click')

// expect(Comp.exists('div.dnb-pagination__indicator')).toBe(true)

await rerenderComponent(Comp)

// expect(Comp.exists('div.dnb-pagination__indicator')).toBe(false)
}

const Comp = mount(
Expand Down Expand Up @@ -563,13 +556,11 @@ describe('Infinity scroller', () => {
resetInfinityHandler = resetInfinity

const action = ({ pageNumber }) => {
act(() => {
setCurrentPage(pageNumber)
setCurrentPage(pageNumber)

if (pageNumber === 1) {
endInfinity()
}
})
if (pageNumber === 1) {
endInfinity()
}
}

return (
Expand Down

0 comments on commit 3081557

Please sign in to comment.