-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
provide keys for arrays items and add tests
- Loading branch information
1 parent
a9433a8
commit e14ad1b
Showing
9 changed files
with
65 additions
and
4 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
54 changes: 54 additions & 0 deletions
54
...Organizations/OrganizationVersion/OrganizationVersionView/OrganizationVersionView.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,54 @@ | ||
import { | ||
QueryClient, | ||
QueryClientProvider, | ||
} from 'react-query'; | ||
import { MemoryRouter } from 'react-router-dom'; | ||
|
||
import { | ||
render, | ||
screen, | ||
} from '@folio/jest-config-stripes/testing-library/react'; | ||
|
||
import { | ||
organization, | ||
organizationAuditEvent, | ||
} from 'fixtures'; | ||
import { ORGANIZATION_VERSIONS_VIEW_ROUTE } from '../../../common/constants'; | ||
import { OrganizationVersionView } from './OrganizationVersionView'; | ||
|
||
const { organizationSnapshot } = organizationAuditEvent; | ||
|
||
const queryClient = new QueryClient(); | ||
const wrapper = ({ children }) => ( | ||
<QueryClientProvider client={queryClient}> | ||
<MemoryRouter | ||
initialEntries={[{ | ||
pathname: ORGANIZATION_VERSIONS_VIEW_ROUTE.replace(':id', organization.id), | ||
}]} | ||
> | ||
{children} | ||
</MemoryRouter> | ||
</QueryClientProvider> | ||
); | ||
|
||
const renderOrganizationVersionView = (props = {}) => render( | ||
<OrganizationVersionView | ||
version={organizationSnapshot.map} | ||
{...props} | ||
/>, | ||
{ wrapper }, | ||
); | ||
|
||
describe('OrganizationVersion', () => { | ||
it('should render version history view', async () => { | ||
renderOrganizationVersionView(); | ||
|
||
expect(screen.getByText('ui-organizations.summary')).toBeInTheDocument(); | ||
expect(screen.getByText('ui-organizations.contactInformation')).toBeInTheDocument(); | ||
expect(screen.getByText('ui-organizations.contactPeople')).toBeInTheDocument(); | ||
expect(screen.getByText('ui-organizations.interface')).toBeInTheDocument(); | ||
expect(screen.getByText('ui-organizations.vendorInformation')).toBeInTheDocument(); | ||
expect(screen.getByText('ui-organizations.vendorTerms')).toBeInTheDocument(); | ||
expect(screen.getByText('ui-organizations.accounts')).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
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