Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(build): Fix lint issues #9938

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ describe('Modal', () => {
test('modal closes with escape', async () => {
const user = userEvent.setup();

render(<Modal {...props} isOpen appendTo={document.body} aria-label="modal-div"/>);
render(<Modal {...props} isOpen appendTo={document.body} aria-label="modal-div" />);

await user.type(screen.getByLabelText("modal-div"), `{${KeyTypes.Escape}}`);
await user.type(screen.getByLabelText('modal-div'), `{${KeyTypes.Escape}}`);
expect(props.onClose).toHaveBeenCalled();
});

Expand All @@ -75,7 +75,11 @@ describe('Modal', () => {
});

test('modal does not show the close button when onClose not passed', () => {
render(<Modal isOpen disableFocusTrap>No close button </Modal>);
render(
<Modal isOpen disableFocusTrap>
No close button{' '}
</Modal>
);
expect(screen.queryByRole('button', { name: 'Close' })).toBeNull();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ test('ModalHeader help renders', () => {
test('Modal Test with custom header', () => {
const header = <span id="test-custom-header">TEST</span>;

const { asFragment } = render(
<ModalHeader>
{header}
</ModalHeader>
);
const { asFragment } = render(<ModalHeader>{header}</ModalHeader>);
expect(asFragment()).toMatchSnapshot();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,27 @@ import { ModalBoxTitle } from '../ModalBoxTitle';
import BullhornIcon from '@patternfly/react-icons/dist/esm/icons/bullhorn-icon';

test('ModalBoxTitle alert variant', () => {
const { asFragment } = render(
<ModalBoxTitle title="Test Modal Box warning" id="boxId" titleIconVariant="warning"/>
);
const { asFragment } = render(<ModalBoxTitle title="Test Modal Box warning" id="boxId" titleIconVariant="warning" />);
expect(asFragment()).toMatchSnapshot();
});

test('ModalBoxTitle info variant', () => {
const { asFragment } = render(
<ModalBoxTitle title="Test Modal Box info" id="boxId" titleIconVariant="info" />
);
const { asFragment } = render(<ModalBoxTitle title="Test Modal Box info" id="boxId" titleIconVariant="info" />);
expect(asFragment()).toMatchSnapshot();
});

test('ModalBoxTitle danger variant', () => {
const { asFragment } = render(
<ModalBoxTitle title="Test Modal Box danger" id="boxId" titleIconVariant="danger" />
);
const { asFragment } = render(<ModalBoxTitle title="Test Modal Box danger" id="boxId" titleIconVariant="danger" />);
expect(asFragment()).toMatchSnapshot();
});

test('ModalBoxTitle custom variant', () => {
const { asFragment } = render(
<ModalBoxTitle title="Test Modal Box warning" id="boxId" titleIconVariant="custom" />
);
const { asFragment } = render(<ModalBoxTitle title="Test Modal Box warning" id="boxId" titleIconVariant="custom" />);
expect(asFragment()).toMatchSnapshot();
});

test('ModalBoxTitle success variant', () => {
const { asFragment } = render(
<ModalBoxTitle title="Test Modal Box success" id="boxId" titleIconVariant="success"/>
);
const { asFragment } = render(<ModalBoxTitle title="Test Modal Box success" id="boxId" titleIconVariant="success" />);
expect(asFragment()).toMatchSnapshot();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ test('Modal Content Test isOpen', () => {

test('Modal Content Test description', () => {
const { asFragment } = render(
<ModalContent
isOpen
{...modalContentProps}
>
<ModalContent isOpen {...modalContentProps}>
This is a ModalBox header
</ModalContent>
);
Expand All @@ -41,12 +38,7 @@ test('Modal Content Test description', () => {

test('Modal Content Test with onclose', () => {
const { asFragment } = render(
<ModalContent
variant="large"
onClose={() => undefined}
isOpen
{...modalContentProps}
>
<ModalContent variant="large" onClose={() => undefined} isOpen {...modalContentProps}>
This is a ModalBox header
</ModalContent>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { render } from '@testing-library/react';
import { ModalFooter } from '../ModalFooter';

test('ModalFooter Test', () => {
const { asFragment } = render(
<ModalFooter className="test-box-footer-class">This is a ModalBox Footer</ModalFooter>
);
const { asFragment } = render(<ModalFooter className="test-box-footer-class">This is a ModalBox Footer</ModalFooter>);
expect(asFragment()).toMatchSnapshot();
});
Loading