Skip to content
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: allow user to go to settings before a product is set up #21146

Merged
merged 16 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions cypress/e2e/before-onboarding.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
describe('Before Onboarding', () => {
before(() => {
cy.request({
method: 'PATCH',
url: '/api/projects/1/',
body: { completed_snippet_onboarding: false },
headers: { Authorization: 'Bearer e2e_demo_api_key' },
Dismissed Show dismissed Hide dismissed
Dismissed Show dismissed Hide dismissed
})
})

after(() => {
cy.request({
method: 'PATCH',
url: '/api/projects/1/',
body: { completed_snippet_onboarding: true },
headers: { Authorization: 'Bearer e2e_demo_api_key' },
})
})

it('Navigate 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('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')
})
})
1 change: 0 additions & 1 deletion cypress/e2e/onboarding.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { urls } from 'scenes/urls'
import { decideResponse } from '../fixtures/api/decide'

describe('Onboarding', () => {
Expand Down
7 changes: 7 additions & 0 deletions cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ beforeEach(() => {
email: '[email protected]',
password: '12345678',
})
cy.visit('/?no-preloaded-app-context=true')
} else if (Cypress.spec.name.includes('before')) {
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
2 changes: 1 addition & 1 deletion frontend/src/scenes/sceneLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export const sceneLogic = kea<sceneLogicType>([
!teamLogic.values.currentTeam.is_demo &&
!removeProjectIdIfPresent(location.pathname).startsWith(urls.onboarding('')) &&
!removeProjectIdIfPresent(location.pathname).startsWith(urls.products()) &&
!removeProjectIdIfPresent(location.pathname).startsWith(urls.settings())
!removeProjectIdIfPresent(location.pathname).startsWith('/settings')
) {
const allProductUrls = Object.values(productUrlMapping).flat()
if (
Expand Down
Loading