Skip to content

Commit

Permalink
test: try to fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
rpenido committed Jan 15, 2024
1 parent fba064b commit 0675714
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/generic/loading-button/LoadingButton.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ describe('<LoadingButton />', () => {
const longFunction = () => new Promise((_resolve, reject) => {
rejecter = reject;
});
const { container, getByRole, getByText } = render(RootWrapper(longFunction), { failIfHandlerThrows: false });
const { container, getByRole, getByText } = render(RootWrapper(longFunction));
const buttonElement = getByRole('button');

fireEvent.click(buttonElement);
fireEvent.click(buttonElement, { bubble: true });

expect(container.getElementsByClassName('icon-spin').length).toBe(1);
expect(getByText(buttonTitle)).toBeInTheDocument();
// StatefulButton only sets aria-disabled (not disabled) when the state is pending
// expect(buttonElement).toBeDisabled();
expect(buttonElement).toHaveAttribute('aria-disabled', 'true');

await act(async () => { rejecter('error'); });
await act(async () => { rejecter(new Error('error')); });

// StatefulButton only sets aria-disabled (not disabled) when the state is pending
// expect(buttonElement).toBeEnabled();
Expand Down

0 comments on commit 0675714

Please sign in to comment.