Skip to content

Commit

Permalink
Add a new before onboarding login flow
Browse files Browse the repository at this point in the history
  • Loading branch information
zlwaterfield committed Mar 26, 2024
1 parent 1bacf24 commit 5e9e01b
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cypress/e2e/before-onboarding.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
describe('Before Onboarding', () => {
it.only('Navigate back to products when a product has not been set up', () => {
cy.visit('/project/1/data-management/events')

cy.get('[data-attr=top-bar-name] > span').contains('Products')
})

it.only('Navigate to a settings page even when a product has not been set up', () => {
cy.visit('/settings/user')

cy.get('[data-attr=top-bar-name] > span').contains('User')

cy.visit('/settings/organization')

cy.get('[data-attr=top-bar-name] > span').contains('Organization')
})
})
46 changes: 46 additions & 0 deletions cypress/fixtures/api/users/user-before-onboarding.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"id": "01788ed8-6d2d-0000-ccdb-d8e17589b1ea",
"distinct_id": "kOyAmTq2McfCD5XvqwjKf8m6GVecm9uN0L0ypEoRN50",
"first_name": "Jane",
"email": "[email protected]",
"email_opt_in": true,
"anonymize_data": false,
"toolbar_mode": "toolbar",
"has_password": true,
"is_staff": false,
"is_impersonated": false,
"team": {
"id": 1,
"uuid": "01787e47-55d7-0000-6976-b893a03aaba8",
"organization": "01787e47-5558-0000-bae1-6bc513b42abe",
"api_token": "dtrwW0uEC7LwVx64RmZmqog_XjU0nXWuEK1d1ZpjteQ",
"name": "Hogflix Demo App 2",
"completed_snippet_onboarding": false,
"ingested_event": false,
"is_demo": true,
"timezone": "UTC"
},
"organization": {
"id": "01787e47-5558-0000-bae1-6bc513b42abe",
"name": "Hogflix Movies",
"created_at": "2021-03-29T13:58:27.416616Z",
"updated_at": "2021-03-29T13:58:57.067131Z",
"membership_level": 15,
"plugins_access_level": 9,
"teams": [
{
"id": 1,
"uuid": "01787e47-55d7-0000-6976-b893a03aaba8",
"organization": "01787e47-5558-0000-bae1-6bc513b42abe",
"api_token": "dtrwW0uEC7LwVx64RmZmqog_XjU0nXWuEK1d1ZpjteQ",
"name": "Hogflix Demo App 2",
"completed_snippet_onboarding": false,
"ingested_event": false,
"is_demo": true,
"timezone": "UTC"
}
],
"available_features": []
},
"organizations": [{ "id": "01787e47-5558-0000-bae1-6bc513b42abe", "name": "Hogflix Movies" }]
}
9 changes: 9 additions & 0 deletions cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ beforeEach(() => {
email: '[email protected]',
password: '12345678',
})
cy.visit('/?no-preloaded-app-context=true')
} else if (Cypress.spec.name.includes('before-onboarding')) {
cy.intercept('/api/users/@me/', { fixture: 'api/users/user-before-onboarding' })

cy.request('POST', '/api/login/', {
email: '[email protected]',
password: '12345678',
})

cy.visit('/?no-preloaded-app-context=true')
} else {
cy.intercept('GET', /\/api\/projects\/\d+\/insights\/?\?/).as('getInsights')
Expand Down

0 comments on commit 5e9e01b

Please sign in to comment.