diff --git a/lib/AffiliationsSelection/AffiliationsSelection.test.js b/lib/AffiliationsSelection/AffiliationsSelection.test.js index 3318f3ce..e2175546 100644 --- a/lib/AffiliationsSelection/AffiliationsSelection.test.js +++ b/lib/AffiliationsSelection/AffiliationsSelection.test.js @@ -36,7 +36,7 @@ const renderAffiliationsSelection = (props = {}) => render( ); describe('AffiliationsSelection', () => { - it('should render affiliation selection with provided options', async () => { + it('should render affiliation selection with provided options', () => { renderAffiliationsSelection(); expect( diff --git a/lib/FieldLocation/FieldLocationFinalContainer.test.js b/lib/FieldLocation/FieldLocationFinalContainer.test.js index 725add2d..3b80b458 100644 --- a/lib/FieldLocation/FieldLocationFinalContainer.test.js +++ b/lib/FieldLocation/FieldLocationFinalContainer.test.js @@ -32,16 +32,12 @@ const renderFieldLocationFinalContainer = (props = {}, formProps = {}) => (rende )); describe('FieldLocationFinalContainer component', () => { - beforeEach(() => { - renderFieldLocationFinalContainer(); + it('should display passed label', () => { + renderFieldLocationFinalContainer({ labelId: 'Location' }); const button = screen.getByText('stripes-components.selection.controlLabel'); fireEvent.click(button); - }); - - it('should display passed label', () => { - renderFieldLocationFinalContainer({ labelId: 'Location' }); expect(screen.getByText(fieldLocationLabel)).toBeDefined(); }); @@ -49,6 +45,10 @@ describe('FieldLocationFinalContainer component', () => { it('should render options based on passed locationIds', async () => { renderFieldLocationFinalContainer(); + const button = screen.getByText('stripes-components.selection.controlLabel'); + + fireEvent.click(button); + const renderedLocationOptions = await screen.findAllByText(/Location #[0-9]/); expect(renderedLocationOptions.length).toBe(locationsIds.length); @@ -59,6 +59,10 @@ describe('FieldLocationFinalContainer component', () => { filterLocations: (records) => records.slice(0, 2), }); + const button = screen.getByText('stripes-components.selection.controlLabel'); + + fireEvent.click(button); + const renderedLocationOptions = await screen.findAllByText(/Location #[0-9]/); expect(renderedLocationOptions).toHaveLength(2); diff --git a/lib/LanguageFilter/LanguageFilter.test.js b/lib/LanguageFilter/LanguageFilter.test.js index adf6ff6b..a9f3acfb 100644 --- a/lib/LanguageFilter/LanguageFilter.test.js +++ b/lib/LanguageFilter/LanguageFilter.test.js @@ -1,5 +1,4 @@ import { - cleanup, fireEvent, render, } from '@testing-library/react';