Skip to content

Commit

Permalink
tests: add test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
alisher-epam committed Oct 23, 2023
1 parent dfa458b commit 2210b9c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/Settings/BankingInformationSettings/constants.js

This file was deleted.

15 changes: 15 additions & 0 deletions src/Settings/SettingsPage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import { useBankingInformation } from './hooks';
jest.mock('@folio/stripes/core');
jest.mock('@folio/stripes/smart-components');

jest.mock('@folio/stripes/components', () => ({
...jest.requireActual('@folio/stripes/components'),
Loading: () => <div>Loading</div>,
}));
jest.mock('./hooks', () => ({
useBankingInformation: jest.fn(() => ({
isLoading: false,
Expand Down Expand Up @@ -57,4 +61,15 @@ describe('SettingsPage', () => {

expect(screen.getByText('ui-organizations.settings.bankingAccountTypes')).toBeInTheDocument();
});

it('should display loading on fetching useBankingInformation', async () => {
useBankingInformation.mockReturnValue({
isLoading: true,
enabled: false,
});

renderSettingsPage();

expect(screen.getByText('Loading')).toBeInTheDocument();
});
});

0 comments on commit 2210b9c

Please sign in to comment.