Skip to content

Commit

Permalink
refactor: fix code quality based on comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alisher-epam committed Sep 25, 2024
1 parent c34d15f commit 972efe2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/AffiliationsSelection/AffiliationsSelection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
16 changes: 10 additions & 6 deletions lib/FieldLocation/FieldLocationFinalContainer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@ 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();
});

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);
Expand All @@ -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);
Expand Down
1 change: 0 additions & 1 deletion lib/LanguageFilter/LanguageFilter.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
cleanup,
fireEvent,
render,
} from '@testing-library/react';
Expand Down

0 comments on commit 972efe2

Please sign in to comment.