-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into stateful-rendering-of-annotations-doc-view
- Loading branch information
Showing
23 changed files
with
294 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
|
||
import { render } from '@testing-library/react'; | ||
import AdminHeader from './AdminHeader'; | ||
|
||
test('renders admin header tabs (key=dashboard)', async () => { | ||
const { getByTestId } = render( | ||
<AdminHeader | ||
activeKey="dashboard" | ||
setKey={jest.fn} | ||
/>, | ||
); | ||
const adminTabs = getByTestId('admin-tabs'); | ||
expect(adminTabs).toBeInTheDocument(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
|
||
import { render } from '@testing-library/react'; | ||
import AdminPanel from './AdminPanel'; | ||
import { adminUserSession } from '../../../utils/testUtil'; | ||
|
||
test('renders admin panel', async () => { | ||
const { getByTestId } = render( | ||
<AdminPanel | ||
alerts={[]} | ||
setAlerts={jest.fn} | ||
session={adminUserSession} | ||
activeKey="dashboard" | ||
setKey={jest.fn} | ||
/>, | ||
); | ||
const adminPanel = getByTestId('admin-panel'); | ||
expect(adminPanel).toBeInTheDocument(); | ||
}); |
12 changes: 12 additions & 0 deletions
12
src/components/Admin/AdminRoleBadge/AdminRoleBadge.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
|
||
import { render } from '@testing-library/react'; | ||
import AdminRoleBadge from './AdminRoleBadge'; | ||
|
||
test('renders admin role badge', async () => { | ||
const { getByTestId } = render(<AdminRoleBadge />); | ||
const roleBadge = getByTestId('admin-role-badge'); | ||
expect(roleBadge).toBeInTheDocument(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/components/Admin/Document/AdminDocumentTable/AdminDocumentTable.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
|
||
import { render } from '@testing-library/react'; | ||
import AdminDocumentTable from './AdminDocumentTable'; | ||
import { document } from '../../../../utils/testUtil'; | ||
|
||
test('renders admin doc view', async () => { | ||
const { getByTestId } = render( | ||
<AdminDocumentTable | ||
document={document} | ||
setAlerts={jest.fn} | ||
alerts={[]} | ||
/>, | ||
); | ||
const docView = getByTestId('admin-doc-view'); | ||
expect(docView).toBeInTheDocument(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/components/Admin/Group/AdminGroupTable/AdminGroupTable.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
|
||
import { render } from '@testing-library/react'; | ||
import AdminGroupTable from './AdminGroupTable'; | ||
import { group } from '../../../../utils/testUtil'; | ||
|
||
test('renders admin group view', async () => { | ||
const { getByTestId } = render( | ||
<AdminGroupTable | ||
group={group} | ||
setAlerts={jest.fn} | ||
alerts={[]} | ||
/>, | ||
); | ||
const groupTable = getByTestId('admin-group-view'); | ||
expect(groupTable).toBeInTheDocument(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/components/Admin/SortableHeader/SortableHeader.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
|
||
import { render } from '@testing-library/react'; | ||
import { ArrowUp } from 'react-bootstrap-icons'; | ||
import SortableHeader from './SortableHeader'; | ||
|
||
test('renders sortable header (no children)', async () => { | ||
const { getByTestId } = render( | ||
<table> | ||
<thead> | ||
<tr> | ||
<SortableHeader | ||
field="createdAt" | ||
setSortState={jest.fn} | ||
sortState={{ field: 'createdAt', direction: 'desc' }} | ||
SortIcon={jest.fn().mockReturnValue(<ArrowUp />)} | ||
/> | ||
</tr> | ||
</thead> | ||
</table>, | ||
); | ||
const sortableHeader = getByTestId('sortable-header'); | ||
expect(sortableHeader).toBeInTheDocument(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/components/Admin/User/AdminUserTable/AdminAnnotation/AdminAnnotation.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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( | ||
<AdminAnnotation | ||
annotation={annotation} | ||
/>, | ||
); | ||
const adminAnnotation = getByTestId('admin-annotation'); | ||
expect(adminAnnotation).toBeInTheDocument(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.