From 3081557eb5ab2e69ca5b7c445f26b1fab87e41a1 Mon Sep 17 00:00:00 2001 From: Tobias Date: Tue, 23 Nov 2021 10:57:35 +0100 Subject: [PATCH] chore: remove "act" as we do not have any reason to use it anymore --- .../pagination/__tests__/Pagination.test.js | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/packages/dnb-eufemia/src/components/pagination/__tests__/Pagination.test.js b/packages/dnb-eufemia/src/components/pagination/__tests__/Pagination.test.js index 985795d957b..e0eeb2e6807 100644 --- a/packages/dnb-eufemia/src/components/pagination/__tests__/Pagination.test.js +++ b/packages/dnb-eufemia/src/components/pagination/__tests__/Pagination.test.js @@ -4,7 +4,6 @@ */ import React from 'react' -import { act } from '@testing-library/react' import { mount, fakeProps, @@ -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 ( @@ -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( @@ -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 (