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

35 lines
1.1 KiB
TypeScript
Raw Normal View History

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')
})
})