-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix hubspot form build #592
Changes from all commits
4bfe12b
02cec2b
4f74594
63dfc14
dd5242c
387b546
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Hubspot newsletter | ||
REACT_APP_HUBSPOT_PORTAL_ID=25945010 | ||
REACT_APP_HUBSPOT_FORM_GUID=991e2a09-77c2-4428-9242-ebf26bfc6c64 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
const WAITING_TIME = Cypress.env('waitingTime') | ||
|
||
describe(`Right side panel`, () => { | ||
beforeEach(() => { | ||
cy.saveApiTokenCookie() | ||
|
@@ -18,4 +20,13 @@ describe(`Right side panel`, () => { | |
cy.get('button[aria-label="Open Panel"]').click() | ||
cy.get('[data-testid="right-panel"]').should('be.visible') | ||
}) | ||
|
||
it('Should allow subscribing to the newsletter', () => { | ||
cy.get('input[placeholder="Enter your email"]').type('[email protected]') | ||
cy.get('button[aria-label="Subscribe"]').click() | ||
cy.wait(WAITING_TIME) | ||
cy.get('[data-testid="right-panel"]').within(() => { | ||
cy.get('p').should('contain', 'Thanks for subscribing!') | ||
}) | ||
}) | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "mini-dashboard", | ||
"version": "0.2.17", | ||
"version": "0.2.18", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we create a different PR for the version upgrade? 🙏 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We want to be fast on this one since the engine team is waiting + timezone issue between Laurent and us, so I would go with this even if it's not really clean, I agree 😊 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the feedback, I will keep that in mind for the future. |
||
"private": true, | ||
"dependencies": { | ||
"@meilisearch/instant-meilisearch": "0.24", | ||
|
@@ -22,8 +22,9 @@ | |
}, | ||
"scripts": { | ||
"version-script": "node version-script.js", | ||
"prestart": "yarn version-script", | ||
"prebuild": "yarn version-script", | ||
"validate-env": "node validate-env.js", | ||
"prestart": "yarn version-script && yarn validate-env", | ||
"prebuild": "yarn version-script && yarn validate-env", | ||
"start": "react-scripts start", | ||
"start:ci": "REACT_APP_MEILI_SERVER_ADDRESS=http://meilisearch:7700 react-scripts start", | ||
"build": "react-scripts build", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export default '0.2.17' | ||
export default '0.2.18' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* eslint-disable no-console */ | ||
|
||
const requiredEnv = ['REACT_APP_API_URL', 'REACT_APP_ANOTHER_ENV_VAR'] | ||
|
||
const missingEnv = requiredEnv.filter((env) => !process.env[env]) | ||
|
||
if (missingEnv.length > 0) { | ||
console.error( | ||
`Missing required environment variables: ${missingEnv.join(', ')}` | ||
) | ||
process.exit(1) | ||
} | ||
console.log('All required environment variables are set.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this trigger the subscription, or is it caught somewhere to not send it in testing environment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This triggers a subscription, but nothing happens when you subscribe with an existing email.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain what you mean by "nothing happens when you subscribe with an existing email"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can see that there are multiple submissions, but the contact is simply "upserted" there is no duplicate contacts created in HubSpot. You can see the forms submissions here: https://app-eu1.hubspot.com/submissions/25945010/form/991e2a09-77c2-4428-9242-ebf26bfc6c64/submissions?redirectUrl=https://app-eu1.hubspot.com/forms/25945010/views/all_forms
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I'm wondering if we could have improved it by either providing a fake email or having intercepted the request to avoid spamming Hubspot's API 🤔
Approving for now since it's urgent but we should consider doing this test in a different way 🥲