Skip to content

Commit

Permalink
added component test
Browse files Browse the repository at this point in the history
  • Loading branch information
chopkinsmade committed Jan 5, 2024
1 parent 9405233 commit 60f53a2
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/component/cypress/specs/Tasks/TaskForm/TaskFormFields.cy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,30 @@ describe('Task form', () => {
})
})

describe('Adding a task form', () => {
context('When a task form renders with an interaction', () => {
beforeEach(() => {
cy.mount(
<Component
cancelRedirectUrl={urls.companies.index()}
task={{ interaction: { id: 1, subject: 'a', notes: 'b' } }}
/>
)
})

it('should hide the company field select', () => {
assertNotExists('[data-test="field-company"')
})

it('should hide the investment project field select', () => {
assertNotExists('[data-test="field-investmentProject"')
})

it('should render the cancel button with the correct url', () => {
assertLink('cancel-button', urls.companies.index())
})
})
})
describe('Editing a task form', () => {
context('When a generic task form renders with existing data', () => {
const task = taskFaker()
Expand Down

0 comments on commit 60f53a2

Please sign in to comment.