forked from metabase/metabase
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix funnels with zero initial step (metabase#19030)
- Loading branch information
Showing
2 changed files
with
92 additions
and
25 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
62 changes: 62 additions & 0 deletions
62
frontend/test/metabase-visual/visualizations/funnel.cy.spec.js
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,62 @@ | ||
import { restore, visitQuestionAdhoc } from "__support__/e2e/cypress"; | ||
|
||
describe("visual tests > visualizations > funnel", () => { | ||
beforeEach(() => { | ||
restore(); | ||
cy.signInAsNormalUser(); | ||
cy.server(); | ||
cy.route("POST", "/api/dataset").as("dataset"); | ||
}); | ||
|
||
it("empty", () => { | ||
const testQuery = { | ||
type: "native", | ||
native: { | ||
query: | ||
"select 'a' col1, 0 col2 union all\n" + | ||
"select 'b', 0 union all\n" + | ||
"select 'c', 0", | ||
}, | ||
database: 1, | ||
}; | ||
|
||
visitQuestionAdhoc({ | ||
dataset_query: testQuery, | ||
display: "funnel", | ||
visualization_settings: { | ||
"funnel.type": "funnel", | ||
}, | ||
}); | ||
|
||
cy.wait("@dataset"); | ||
|
||
cy.percySnapshot(); | ||
}); | ||
|
||
it("normal", () => { | ||
const testQuery = { | ||
type: "native", | ||
native: { | ||
query: | ||
"select 'a' step, 1000 users union all\n" + | ||
"select 'b', 800 union all\n" + | ||
"select 'c', 400 union all\n" + | ||
"select 'd', 155 union all\n" + | ||
"select 'e', 0", | ||
}, | ||
database: 1, | ||
}; | ||
|
||
visitQuestionAdhoc({ | ||
dataset_query: testQuery, | ||
display: "funnel", | ||
visualization_settings: { | ||
"funnel.type": "funnel", | ||
}, | ||
}); | ||
|
||
cy.wait("@dataset"); | ||
|
||
cy.percySnapshot(); | ||
}); | ||
}); |