From 49a8966dfd8f839e68883c36a24a1ce27351e638 Mon Sep 17 00:00:00 2001 From: Ben Silverman Date: Wed, 18 Nov 2020 16:57:41 -0700 Subject: [PATCH] #17 Test for AdminAnnotation --- .../AdminAnnotation/AdminAnnotation.js | 1 + .../AdminAnnotation/AdminAnnotation.test.js | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 src/components/Admin/User/AdminUserTable/AdminAnnotation/AdminAnnotation.test.js diff --git a/src/components/Admin/User/AdminUserTable/AdminAnnotation/AdminAnnotation.js b/src/components/Admin/User/AdminUserTable/AdminAnnotation/AdminAnnotation.js index 3266c568..fd23fe06 100644 --- a/src/components/Admin/User/AdminUserTable/AdminAnnotation/AdminAnnotation.js +++ b/src/components/Admin/User/AdminUserTable/AdminAnnotation/AdminAnnotation.js @@ -13,6 +13,7 @@ const AdminAnnotation = ({ annotation }) => ( size="sm" variant="light" style={{ border: '1px solid gray', borderCollapse: 'separate' }} + data-testid="admin-annotation" > diff --git a/src/components/Admin/User/AdminUserTable/AdminAnnotation/AdminAnnotation.test.js b/src/components/Admin/User/AdminUserTable/AdminAnnotation/AdminAnnotation.test.js new file mode 100644 index 00000000..94a78b86 --- /dev/null +++ b/src/components/Admin/User/AdminUserTable/AdminAnnotation/AdminAnnotation.test.js @@ -0,0 +1,17 @@ +/** + * @jest-environment jsdom + */ + +import { render } from '@testing-library/react'; +import AdminAnnotation from './AdminAnnotation'; +import { annotation } from '../../../../../utils/testUtil'; + +test('renders annotation', async () => { + const { getByTestId } = render( + , + ); + const adminAnnotation = getByTestId('admin-annotation'); + expect(adminAnnotation).toBeInTheDocument(); +});