From e1e388f34be28b28e2fbd0ae0d17be5a8300d97f Mon Sep 17 00:00:00 2001 From: Anna Hughes Date: Tue, 29 Oct 2024 09:23:18 +0000 Subject: [PATCH] Fix messaging tests (#1170) --- .../workflows/community-pr-check-issue.yml | 2 +- .github/workflows/community-pr-labeler.yml | 2 +- .../tests/create-access-code.badoo.cy.tsx | 2 +- .../tests/initial-exploration.cy.tsx | 4 +-- cypress/integration/tests/user-chat.cy.tsx | 29 ----------------- .../integration/tests/user-messaging.cy.tsx | 31 +++++++++++++++++++ scripts/github-actions/checkPRLinkedIssue.js | 12 ++++++- 7 files changed, 47 insertions(+), 35 deletions(-) delete mode 100644 cypress/integration/tests/user-chat.cy.tsx create mode 100644 cypress/integration/tests/user-messaging.cy.tsx diff --git a/.github/workflows/community-pr-check-issue.yml b/.github/workflows/community-pr-check-issue.yml index 9f486176..82159f4d 100644 --- a/.github/workflows/community-pr-check-issue.yml +++ b/.github/workflows/community-pr-check-issue.yml @@ -3,7 +3,7 @@ on: pull_request: types: [opened, edited] branches: - - "develop" + - 'develop' jobs: Check-For-Linked-Issue: diff --git a/.github/workflows/community-pr-labeler.yml b/.github/workflows/community-pr-labeler.yml index 3ef4cb63..c7a19342 100644 --- a/.github/workflows/community-pr-labeler.yml +++ b/.github/workflows/community-pr-labeler.yml @@ -16,7 +16,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: "20" + node-version: '20' - name: Install dependencies run: npm install @actions/github @actions/core diff --git a/cypress/integration/tests/create-access-code.badoo.cy.tsx b/cypress/integration/tests/create-access-code.badoo.cy.tsx index 00a2608d..d07477e5 100644 --- a/cypress/integration/tests/create-access-code.badoo.cy.tsx +++ b/cypress/integration/tests/create-access-code.badoo.cy.tsx @@ -29,7 +29,7 @@ describe('Create access code page should display', () => { .should('have.prop', 'type', 'radio') .should('have.value', 'therapy') .parents('label') - .contains('Courses, 1:1 chat and six therapy sessions'); + .contains('Courses, messaging and six therapy sessions'); cy.get('button').contains('Create access codes').should('have.prop', 'type', 'submit'); }); diff --git a/cypress/integration/tests/initial-exploration.cy.tsx b/cypress/integration/tests/initial-exploration.cy.tsx index 759b9034..1d258ac3 100644 --- a/cypress/integration/tests/initial-exploration.cy.tsx +++ b/cypress/integration/tests/initial-exploration.cy.tsx @@ -2,7 +2,7 @@ describe('Initial exploration', () => { it('should be able to explore all pages', () => { cy.visit('/'); cy.get('h1', { timeout: 8000 }).contains('Join us on your healing journey'); - cy.get(`[qa-id=secondary-nav-chat-button]`).click(); + cy.get(`[qa-id=secondary-nav-messaging-button]`).click(); cy.get('a', { timeout: 8000 }).contains('Get started'); cy.get(`[qa-id=secondary-nav-grounding-button]`).click(); cy.get('a', { timeout: 8000 }).contains('Get started'); @@ -21,7 +21,7 @@ describe('Initial exploration', () => { it('a user with partner referral should be able to explore all pages for partners', () => { cy.visit('/welcome/bumble'); cy.get('h1', { timeout: 8000 }).contains('Join us on your healing journey'); - cy.get(`[qa-id=secondary-nav-chat-button]`).click(); + cy.get(`[qa-id=secondary-nav-messaging-button]`).click(); cy.get('a', { timeout: 8000 }).contains('Get started'); cy.get(`[qa-id=secondary-nav-grounding-button]`).click(); cy.get('a', { timeout: 8000 }).contains('Get started'); diff --git a/cypress/integration/tests/user-chat.cy.tsx b/cypress/integration/tests/user-chat.cy.tsx deleted file mode 100644 index 947d240c..00000000 --- a/cypress/integration/tests/user-chat.cy.tsx +++ /dev/null @@ -1,29 +0,0 @@ -describe('A logged in public user can', () => { - const email = `cypresstestemail+${Date.now()}@chayn.co`; - const password = 'testtesttest'; - - before(() => { - cy.cleanUpTestState(); - cy.createUser({ emailInput: email, passwordInput: password }); - cy.logInWithEmailAndPassword(email, password); - }); - - it('Navigate to the chat page and begin a chat', () => { - cy.visit('/'); //intitial home page visit - cy.get(`[qa-id=secondary-nav-chat-button]`, { timeout: 8000 }).should('exist').click(); //go to chat page - }); - - it('see the More about section', () => { - cy.visit('/messaging'); - cy.get('h2').contains('More about how 1-1 Chat works'); - cy.checkImage('alt', 'illustration_leaf_mix'); - cy.get('p').contains('Who am I speaking to? Am I always chatting with the same person?'); - cy.get('p').contains( - 'We are a group of survivors and allies based all over the world who care about your healing journey. Because of our different time zones and the way we run our chat service, you won’t always be speaking with the same person. You can find out more about our team and who we are', - ); - }); - - after(() => { - cy.logout(); - }); -}); diff --git a/cypress/integration/tests/user-messaging.cy.tsx b/cypress/integration/tests/user-messaging.cy.tsx new file mode 100644 index 00000000..95e39cce --- /dev/null +++ b/cypress/integration/tests/user-messaging.cy.tsx @@ -0,0 +1,31 @@ +describe('A logged in public user can', () => { + const email = `cypresstestemail+${Date.now()}@chayn.co`; + const password = 'testtesttest'; + + before(() => { + cy.cleanUpTestState(); + cy.createUser({ emailInput: email, passwordInput: password }); + cy.logInWithEmailAndPassword(email, password); + }); + + it('Navigate to the messaging page and begin a messaging', () => { + cy.visit('/'); //intitial home page visit + cy.get(`[qa-id=secondary-nav-messaging-button]`, { timeout: 8000 }).should('exist').click(); //go to messaging page + }); + + it('see the More about section', () => { + cy.visit('/messaging'); + cy.get('h2').contains('Tell us what’s on your mind'); + cy.get('h2').contains('Meet the Bloom team'); + cy.get('h2').contains('More about how Bloom’s Messaging works'); + cy.checkImage('alt', 'Illustration of a person sitting'); + cy.get('p').contains('Who is 1-1 Messaging for?'); + cy.get('p').contains( + '1-1 Messaging is available for everyone using Bloom, regardless of your background, race, age, disability, religion or belief, sexuality, gender identity or expression, or life circumstances—we are here for you.', + ); + }); + + after(() => { + cy.logout(); + }); +}); diff --git a/scripts/github-actions/checkPRLinkedIssue.js b/scripts/github-actions/checkPRLinkedIssue.js index 961bd90f..33c74ec7 100644 --- a/scripts/github-actions/checkPRLinkedIssue.js +++ b/scripts/github-actions/checkPRLinkedIssue.js @@ -9,7 +9,17 @@ async function main({ g, c }) { const prBody = context.payload.pull_request.body; const prNumber = context.payload.pull_request.number; const prOwner = context.payload.pull_request.user.login; - const exemptPrOwners = ['kyleecodes', 'swetha-charles', 'eleanorreem', 'annarhughes', 'tarebyte', 'dependabot[bot]', 'dependabot', 'github-actions[bot]', 'github-actions']; + const exemptPrOwners = [ + 'kyleecodes', + 'swetha-charles', + 'eleanorreem', + 'annarhughes', + 'tarebyte', + 'dependabot[bot]', + 'dependabot', + 'github-actions[bot]', + 'github-actions', + ]; const regex = /(?!<!--)(?:close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved)\s*#(\d+)(?![^<]*-->)/gi; const match = prBody.match(regex);