Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix(modal): tests
  • Loading branch information
stephl3 committed Oct 7, 2025
commit 98ad0f9a921dd7dae47a29675eccc913f72cdbb4
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ describe('packages/confirmation-modal', () => {
});

test('does not render if closed', () => {
const { getByText } = renderModal();
expect(getByText('Content text')).not.toBeVisible();
const { queryByText } = renderModal();
expect(queryByText('Content text')).toBeNull();
});

test('renders if open', () => {
Expand Down Expand Up @@ -329,14 +329,18 @@ describe('packages/confirmation-modal', () => {
</ConfirmationModal>,
);

const rerenderedConfirmationButton = await findByTestId(
lgIds.confirm,
);

if (requiredInputText) {
textInput = getByLabelText(
`Type "${requiredInputText}" to confirm your action`,
);
expect(textInput).toHaveValue('');
}

expect(confirmationButton).toHaveAttribute(
expect(rerenderedConfirmationButton).toHaveAttribute(
'aria-disabled',
disabledAfterReopeningModal.toString(),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ describe('packages/marketing-modal', () => {
});
});
test('does not render if closed', () => {
const { getByText } = renderModal();
expect(getByText('Content text')).not.toBeVisible();
const { queryByText } = renderModal();
expect(queryByText('Content text')).toBeNull();
});

test('renders if open', () => {
Expand Down
Loading