mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-24 09:14:46 +01:00
b7bdad90eb
* Add test for bar charts Since our charts are rendered on a canvas we can't really interact well with it. Instead, we take a screenshot now (new dependency). * Debug error in CI * Make sure images are the same size on CI and locally
19 lines
487 B
JavaScript
19 lines
487 B
JavaScript
import 'cypress-plugin-snapshots/commands'
|
|
|
|
const patternHandler = {}
|
|
|
|
Cypress.Commands.add('interceptLazy', (pattern, handler) => {
|
|
patternHandler[pattern] = handler
|
|
return cy.intercept(pattern, (req) => {
|
|
req.reply(patternHandler[pattern]())
|
|
})
|
|
})
|
|
|
|
Cypress.Commands.add('overrideInterceptLazy', (pattern, handler) => {
|
|
patternHandler[pattern] = handler
|
|
})
|
|
|
|
Cypress.Commands.add('map', { prevSubject: true }, (subject, method) => {
|
|
return method(subject)
|
|
})
|