Skip to content

Commit

Permalink
fix: fix tests and build
Browse files Browse the repository at this point in the history
  • Loading branch information
Noggling committed Nov 13, 2023
1 parent 7769a42 commit bf0667f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const NewIncident = ({ onClose }: NewIncidentProps) => {
}, [isSubmitSuccessful]);

if (uploadFilesError || uploadFilesErrors) {
return 'could create incident but files failed to upload';
return <>'could create incident but files failed to upload';</>;
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { MessageCard, Variant } from './MessageCard';
describe('MessageCard', () => {
it('renders an Info message card', () => {
const title = 'Info Title';
const messages = [{ message: 'Info Message 1' }, { message: 'Info Message 2' }];
const messages = ['Info Message 1', 'Info Message 2'];
const type: Variant = 'Info';

render(<MessageCard title={title} messages={messages} type={type} />);
Expand All @@ -18,14 +18,14 @@ describe('MessageCard', () => {
expect(titleElement).toBeInTheDocument();
expect(infoIcon).toBeInTheDocument();
messages.forEach((message) => {
const messageElement = screen.getByText(message.message);
const messageElement = screen.getByText(message);
expect(messageElement).toBeInTheDocument();
});
});

it('renders a Warning message card', () => {
const title = 'Warning Title';
const messages = [{ message: 'Warning Message 1' }, { message: 'Warning Message 2' }];
const messages = ['Warning Message 1', 'Warning Message 2'];
const type: Variant = 'Warning';

render(<MessageCard title={title} messages={messages} type={type} />);
Expand All @@ -38,14 +38,14 @@ describe('MessageCard', () => {
expect(titleElement).toBeInTheDocument();
expect(warningIcon).toBeInTheDocument();
messages.forEach((message) => {
const messageElement = screen.getByText(message.message);
const messageElement = screen.getByText(message);
expect(messageElement).toBeInTheDocument();
});
});

it('renders an Error message card', () => {
const title = 'Error Title';
const messages = [{ message: 'Error Message 1' }, { message: 'Error Message 2' }];
const messages = ['Error Message 1', 'Error Message 2'];
const type: Variant = 'Error';

render(<MessageCard title={title} messages={messages} type={type} />);
Expand All @@ -58,7 +58,7 @@ describe('MessageCard', () => {
expect(titleElement).toBeInTheDocument();
expect(errorIcon).toBeInTheDocument();
messages.forEach((message) => {
const messageElement = screen.getByText(message.message);
const messageElement = screen.getByText(message);
expect(messageElement).toBeInTheDocument();
});
});
Expand Down

0 comments on commit bf0667f

Please sign in to comment.