Skip to content

Commit

Permalink
Fix contact local header component tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgain committed Dec 17, 2024
1 parent 07368df commit ae050e2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/client/components/ContactLocalHeader/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ const ContactLocalHeader = ({ contact, writeFlashMessage }) => {
</GridRow>
{contact.archived && (
<ArchivePanel
archivedBy={contact.archivedBy ? contact.archivedBy : ''}
archivedOn={contact.archivedOn ? contact.archivedOn : ''}
archiveReason={contact.archivedReason}
archivedBy={contact.archived_by}
archivedOn={contact.archived_on}
archiveReason={contact.archived_reason}
unarchiveUrl={urls.contacts.unarchive(contact.id)}
onClick={() => {
writeFlashMessage('Contact record updated')
Expand Down
14 changes: 14 additions & 0 deletions test/component/cypress/specs/Contacts/ContactLocalHeader.cy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,20 @@ describe('ContactLocalHeader', () => {
it('should render the archive panel', () => {
cy.get('[data-test=archive-panel]').should('exist')
})

it('should render an archived message', () => {
cy.get('[data-test="archive-message"]').should(
'have.text',
'This contact was archived on 04 Jul 2019 by Bernard Harris-Patel.'
)
})

it('should render an archived reason', () => {
cy.get('[data-test="archive-reason"]').should(
'have.text',
'Reason: Left the company'
)
})
})
})

Expand Down

0 comments on commit ae050e2

Please sign in to comment.