Skip to content

Commit

Permalink
tests: fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alisher-epam committed Nov 1, 2023
1 parent e2f626a commit 8e0010c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ describe('BankingInformationSettings component', () => {
it('should display pane headings', () => {
renderBankingInformationSettings();

const paneTitle = screen.getAllByText('ui-organizations.settings.bankingInformation');
const paneTitle = screen.getByText('ui-organizations.settings.bankingInformation');
const checkboxLabel = screen.getByText('ui-organizations.settings.bankingInformation.enable');

expect(paneTitle).toHaveLength(2);
expect(paneTitle).toBeInTheDocument();
expect(checkboxLabel).toBeInTheDocument();
});

it('should render Loading component', () => {
Expand Down Expand Up @@ -69,7 +71,7 @@ describe('BankingInformationSettings component', () => {

renderBankingInformationSettings();

const checkbox = screen.getByRole('checkbox', { name: 'ui-organizations.settings.bankingInformation' });
const checkbox = screen.getByRole('checkbox', { name: 'ui-organizations.settings.bankingInformation.enable' });
const saveButton = screen.getByText('ui-organizations.settings.accountTypes.save.button');

await act(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ describe('BankingInformationSettingsForm component', () => {
it('should render component', async () => {
renderBankingInformationSettingsForm();

expect(screen.getAllByLabelText('ui-organizations.settings.bankingInformation')).toHaveLength(2);
expect(screen.getByLabelText('ui-organizations.settings.bankingInformation')).toBeInTheDocument();
});

it('should save banking options', async () => {
renderBankingInformationSettingsForm();

const checkbox = screen.getByRole('checkbox', { name: 'ui-organizations.settings.bankingInformation' });
const checkbox = screen.getByRole('checkbox', { name: 'ui-organizations.settings.bankingInformation.enable' });
const saveButton = screen.getByText('ui-organizations.settings.accountTypes.save.button');

await act(async () => {
Expand Down

0 comments on commit 8e0010c

Please sign in to comment.