-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix-survey-task
- Loading branch information
Showing
551 changed files
with
11,244 additions
and
11,909 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
cypress/e2e/insights-date-picker.ts → cypress/e2e/insights-date-picker.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { urls } from 'scenes/urls' | ||
|
||
import { createInsight } from '../productAnalytics' | ||
|
||
chai.Assertion.addMethod('neverHaveChild', function (childSelector) { | ||
this._obj.on('DOMNodeInserted', () => { | ||
const matchCount = cy.$$(childSelector, this._obj).length | ||
if (matchCount > 0) { | ||
throw new Error( | ||
`Expected element to never have child ${childSelector}, but found ${matchCount} match${ | ||
matchCount > 1 ? 'es' : '' | ||
}` | ||
) | ||
} | ||
}) | ||
}) | ||
|
||
// For tests related to trends please check trendsElements.js | ||
// insight tests were split up because Cypress was struggling with this many tests in one file🙈 | ||
describe('Insights - saved', () => { | ||
it('Data is available immediately', () => { | ||
createInsight('saved insight').then((newInsightId) => { | ||
cy.get('[data-attr=trend-line-graph]').should('exist') // Results cached | ||
cy.visit(urls.insightView(newInsightId)) // Full refresh | ||
cy.get('.InsightViz').should('exist').should('neverHaveChild', '.insight-empty-state') // Only cached data | ||
cy.get('[data-attr=trend-line-graph]').should('exist') | ||
}) | ||
}) | ||
|
||
it('If cache empty, initiate async refresh', () => { | ||
cy.intercept('GET', /\/api\/projects\/\d+\/insights\/?\?[^/]*?refresh=async/).as('getInsightsRefreshAsync') | ||
let newInsightId: string | ||
createInsight('saved insight').then((insightId) => { | ||
newInsightId = insightId | ||
}) | ||
cy.task('resetInsightCache').then(() => { | ||
cy.visit(urls.insightView(newInsightId)) // Full refresh | ||
cy.get('.insight-empty-state').should('exist') // There should be a loading state for a moment | ||
cy.wait('@getInsightsRefreshAsync').then(() => { | ||
cy.get('[data-attr=trend-line-graph]').should('exist') | ||
}) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.