Skip to content

Commit

Permalink
#106 Create UnauthorizedCard component
Browse files Browse the repository at this point in the history
  • Loading branch information
blms committed Dec 29, 2020
1 parent 5028aed commit eaf137f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/UnauthorizedCard/UnauthorizedCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Card } from 'react-bootstrap';

const UnauthorizedCard = () => (
<Card>
<Card.Header><Card.Title>Not authorized</Card.Title></Card.Header>
<Card.Body>Please log in to use the application.</Card.Body>
</Card>
);

export default UnauthorizedCard;
12 changes: 12 additions & 0 deletions src/components/UnauthorizedCard/UnauthorizedCard.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* @jest-environment jsdom
*/

import { render } from '@testing-library/react';
import UnauthorizedCard from './UnauthorizedCard';

test('renders card', () => {
const { getByText } = render(<UnauthorizedCard />);
const cardTitle = getByText('Not authorized');
expect(cardTitle).toBeInTheDocument();
});
3 changes: 3 additions & 0 deletions src/components/UnauthorizedCard/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import UnauthorizedCard from './UnauthorizedCard';

export default UnauthorizedCard;

0 comments on commit eaf137f

Please sign in to comment.