Skip to content
Snippets Groups Projects
Commit 43354983 authored by Atte Keinänen's avatar Atte Keinänen
Browse files

Fix alerts integration tests

parent 84907117
No related merge requests found
......@@ -252,6 +252,7 @@ export default class Question {
const vizSettings = visualizationSettings
? visualizationSettings
: this.card().visualization_settings;
const goalEnabled = vizSettings["graph.show_goal"];
const hasSingleYAxisColumn = vizSettings["graph.metrics"] &&
vizSettings["graph.metrics"].length === 1;
......
......@@ -679,7 +679,7 @@ export const apiUpdateQuestion = (question) => {
await dispatch(fetchAlertsForQuestion(updatedQuestion.id()))
// remove the databases in the store that are used to populate the QB databases list.
// This is done when saving a Card because the newly saved card will be elligable for use as a source query
// This is done when saving a Card because the newly saved card will be eligible for use as a source query
// so we want the databases list to be re-fetched next time we hit "New Question" so it shows up
dispatch(clearRequestState({ statePath: ["metadata", "databases"] }));
......
......@@ -99,6 +99,10 @@ describe("Alerts", () => {
.addBreakout(["datetime-field", ["field-id", 1], "day"])
.question()
.setDisplay("line")
.setVisualizationSettings({
"graph.dimensions": ["CREATED_AT"],
"graph.metrics": ["count"]
})
.setDisplayName("Time series line")
)
......@@ -109,7 +113,12 @@ describe("Alerts", () => {
.addBreakout(["datetime-field", ["field-id", 1], "day"])
.question()
.setDisplay("line")
.setVisualizationSettings({ "graph.show_goal": true, "graph.goal_value": 10 })
.setVisualizationSettings({
"graph.show_goal": true,
"graph.goal_value": 10,
"graph.dimensions": ["CREATED_AT"],
"graph.metrics": ["count"]
})
.setDisplayName("Time series line with goal")
)
......@@ -317,7 +326,6 @@ describe("Alerts", () => {
// as a recipient.
useSharedAdminLogin()
const adminUser = await UserApi.current();
// TODO TODO TODO THIS ALERT HAZ A COMP-LETELY WRONG TYPE!
await AlertApi.create(getDefaultAlert(timeSeriesWithGoalQuestion, adminUser))
useSharedNormalLogin()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment