Skip to content

Commit

Permalink
Add companies to component tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CaitBarnard committed Jan 5, 2024
1 parent c74fc30 commit 923d0f6
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions test/component/cypress/specs/Dashboard/MyTasks/MyTasksTable.cy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ import {
import { keysToSnakeCase } from '../../../../../functional/cypress/fakers/utils'
import Provider from '../../provider'

const companies = [
{
id: '1',
name: 'Company 1',
},
]

describe('My Tasks on the Dashboard', () => {
const Component = (props) => (
<Provider>
Expand Down Expand Up @@ -59,7 +66,13 @@ describe('My Tasks on the Dashboard', () => {
context('When the logged in adviser has three tasks', () => {
beforeEach(() => {
cy.viewport(1024, 768)
cy.mount(<Component myTasks={myTasks} filters={filtersList} />)
cy.mount(
<Component
myTasks={myTasks}
filters={filtersList}
companies={companies}
/>
)
})

it('should display the heading 3 tasks', () => {
Expand Down Expand Up @@ -137,7 +150,7 @@ describe('My Tasks on the Dashboard', () => {
context('When the logged in adviser has no tasks', () => {
beforeEach(() => {
cy.viewport(1024, 768)
cy.mount(<Component myTasks={myTasks} />)
cy.mount(<Component myTasks={myTasks} companies={[]} />)
})
it('should display the heading 0 tasks', () => {
cy.get('h3').should('contain', '0 tasks')
Expand Down Expand Up @@ -172,7 +185,7 @@ describe('My Tasks on the Dashboard', () => {
context('When the logged in adviser has three tasks', () => {
beforeEach(() => {
cy.viewport(1024, 768)
cy.mount(<Component myTasks={myTasks} />)
cy.mount(<Component myTasks={myTasks} companies={companies} />)
})

it('should display the heading 1 task (singular) and not 1 tasks (plural)', () => {
Expand Down

0 comments on commit 923d0f6

Please sign in to comment.