0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-28 18:26:15 +01:00
posthog/cypress/e2e/insights.dataExploration.cy.ts
Paul D'Ambra 8c76766d5a
feat: a little more e2e cypress data exploration tests (#14816)
* feat: a little more e2e cypress data exploration tests

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* tests were passing by accident

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-18 17:38:11 +00:00

35 lines
1.1 KiB
TypeScript

import { urls } from 'scenes/urls'
import { insight } from '../productAnalytics'
import { decideResponse } from '../fixtures/api/decide'
// For tests related to trends please check trendsElements.js
describe('Insights (with data exploration on)', () => {
beforeEach(() => {
cy.intercept('https://app.posthog.com/decide/*', (req) =>
req.reply(
decideResponse({
'data-exploration-query-tab': true,
'data-exploration-insights': true,
})
)
)
cy.visit(urls.insightNew())
})
it('shows the edit as json button', () => {
insight.newInsight('TRENDS', true)
})
it('can shows the query editor', () => {
insight.newInsight('TRENDS', true)
cy.get('[aria-label="Edit code"]').click()
cy.get('[data-attr="query-editor"]').should('exist')
})
it('can edit an insight using the query editor', () => {
insight.newInsight('TRENDS', true)
cy.get('[aria-label="Edit code"]').click()
cy.get('[data-attr="query-editor"]').should('exist')
})
})