Skip to content

Commit

Permalink
chore(build): Fix lint issues (#9938)
Browse files Browse the repository at this point in the history
  • Loading branch information
tlabaj committed Jan 5, 2024
1 parent 7ec2aff commit 5d9a025
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 37 deletions.
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();
});

0 comments on commit 5d9a025

Please sign in to comment.