diff --git a/__tests__/pages/Jobs.test.jsx b/__tests__/pages/Jobs.test.jsx deleted file mode 100644 index 82fbe1867e..0000000000 --- a/__tests__/pages/Jobs.test.jsx +++ /dev/null @@ -1,29 +0,0 @@ -import React from 'react'; -import { mountWithContexts } from '../enzymeHelpers'; -import Jobs from '../../src/pages/Jobs'; - -describe('', () => { - let pageWrapper; - let pageSections; - let title; - - beforeEach(() => { - pageWrapper = mountWithContexts(); - pageSections = pageWrapper.find('PageSection'); - title = pageWrapper.find('Title'); - }); - - afterEach(() => { - pageWrapper.unmount(); - }); - - test('initially renders without crashing', () => { - expect(pageWrapper.length).toBe(1); - expect(pageSections.length).toBe(2); - expect(title.length).toBe(1); - expect(title.props().size).toBe('2xl'); - pageSections.forEach(section => { - expect(section.props().variant).toBeDefined(); - }); - }); -}); diff --git a/__tests__/pages/Jobs/Jobs.test.jsx b/__tests__/pages/Jobs/Jobs.test.jsx new file mode 100644 index 0000000000..5fd09bbc57 --- /dev/null +++ b/__tests__/pages/Jobs/Jobs.test.jsx @@ -0,0 +1,36 @@ +import React from 'react'; +import { createMemoryHistory } from 'history'; +import { mountWithContexts } from '../../enzymeHelpers'; +import Jobs from '../../../src/pages/Jobs'; + +describe('', () => { + test('initially renders succesfully', () => { + mountWithContexts( + + ); + }); + + test('should display correct breadcrumb heading', () => { + const history = createMemoryHistory({ + initialEntries: ['/jobs'], + }); + const match = { path: '/jobs', url: '/jobs', isExact: true }; + + const wrapper = mountWithContexts( + , + { + context: { + router: { + history, + route: { + location: history.location, + match + } + } + } + } + ); + expect(wrapper.find('BreadcrumbHeading').text()).toEqual('Jobs'); + wrapper.unmount(); + }); +}); diff --git a/__tests__/pages/Jobs/screens/Job/Job.test.jsx b/__tests__/pages/Jobs/screens/Job/Job.test.jsx new file mode 100644 index 0000000000..e5ef908692 --- /dev/null +++ b/__tests__/pages/Jobs/screens/Job/Job.test.jsx @@ -0,0 +1,10 @@ +import React from 'react'; +import { mountWithContexts } from '../../../../enzymeHelpers'; +import Job from '../../../../../src/pages/Jobs/Job'; + + +describe('', () => { + test('initially renders succesfully', () => { + mountWithContexts(); + }); +}); diff --git a/__tests__/pages/Jobs/screens/Job/JobDetail.test.jsx b/__tests__/pages/Jobs/screens/Job/JobDetail.test.jsx new file mode 100644 index 0000000000..e490999c50 --- /dev/null +++ b/__tests__/pages/Jobs/screens/Job/JobDetail.test.jsx @@ -0,0 +1,15 @@ +import React from 'react'; +import { mountWithContexts } from '../../../../enzymeHelpers'; +import JobDetail from '../../../../../src/pages/Jobs/JobDetail/'; + +describe('', () => { + const mockDetails = { + name: 'Foo' + }; + + test('initially renders succesfully', () => { + mountWithContexts( + + ); + }); +}); diff --git a/__tests__/pages/Jobs/screens/Job/JobOutput.test.jsx b/__tests__/pages/Jobs/screens/Job/JobOutput.test.jsx new file mode 100644 index 0000000000..c13f2d9256 --- /dev/null +++ b/__tests__/pages/Jobs/screens/Job/JobOutput.test.jsx @@ -0,0 +1,15 @@ +import React from 'react'; +import { mountWithContexts } from '../../../../enzymeHelpers'; +import JobOutput from '../../../../../src/pages/Jobs/JobOutput/'; + +describe('', () => { + const mockDetails = { + name: 'Foo' + }; + + test('initially renders succesfully', () => { + mountWithContexts( + + ); + }); +}); diff --git a/src/pages/Jobs/Job.jsx b/src/pages/Jobs/Job.jsx index bdf5746a51..b5ebf66d17 100644 --- a/src/pages/Jobs/Job.jsx +++ b/src/pages/Jobs/Job.jsx @@ -64,7 +64,6 @@ export class Job extends Component { const { job, - error, loading } = this.state; diff --git a/src/pages/Jobs/Jobs.jsx b/src/pages/Jobs/Jobs.jsx index aabb48d8c0..48bbaf80f6 100644 --- a/src/pages/Jobs/Jobs.jsx +++ b/src/pages/Jobs/Jobs.jsx @@ -17,7 +17,7 @@ class Jobs extends Component { this.state = { breadcrumbConfig: { - '/jobs': i18n._(`Jobs`) + '/jobs': i18n._(t`Jobs`) } } }