From ae050e2de7b8c1c6facf7b274f0d14266ac1b8d3 Mon Sep 17 00:00:00 2001 From: Paul Gain Date: Tue, 17 Dec 2024 11:00:04 +0000 Subject: [PATCH] Fix contact local header component tests --- src/client/components/ContactLocalHeader/index.jsx | 6 +++--- .../specs/Contacts/ContactLocalHeader.cy.jsx | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/client/components/ContactLocalHeader/index.jsx b/src/client/components/ContactLocalHeader/index.jsx index 3842598b91f..3132afa2ac4 100644 --- a/src/client/components/ContactLocalHeader/index.jsx +++ b/src/client/components/ContactLocalHeader/index.jsx @@ -100,9 +100,9 @@ const ContactLocalHeader = ({ contact, writeFlashMessage }) => { {contact.archived && ( { writeFlashMessage('Contact record updated') diff --git a/test/component/cypress/specs/Contacts/ContactLocalHeader.cy.jsx b/test/component/cypress/specs/Contacts/ContactLocalHeader.cy.jsx index 5726a08f457..f92665643ef 100644 --- a/test/component/cypress/specs/Contacts/ContactLocalHeader.cy.jsx +++ b/test/component/cypress/specs/Contacts/ContactLocalHeader.cy.jsx @@ -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' + ) + }) }) })