Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kravets-levko committed Nov 21, 2019
1 parent 2f9637d commit 70b9dc8
Show file tree
Hide file tree
Showing 20 changed files with 47 additions and 47 deletions.
24 changes: 12 additions & 12 deletions client/app/visualizations/chart/Editor/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ describe('Visualizations -> Chart -> Editor (wrapper)', () => {
test('Renders generic wrapper', () => {
const el = mount({ globalSeriesType: 'column' }, { columns: [], rows: [] });

expect(elementExists(el, 'Chart.EditorTabs.General')).toBeTruthy();
expect(elementExists(el, 'Chart.EditorTabs.XAxis')).toBeTruthy();
expect(elementExists(el, 'Chart.EditorTabs.YAxis')).toBeTruthy();
expect(elementExists(el, 'Chart.EditorTabs.Series')).toBeTruthy();
expect(elementExists(el, 'Chart.EditorTabs.Colors')).toBeTruthy();
expect(elementExists(el, 'Chart.EditorTabs.DataLabels')).toBeTruthy();
expect(elementExists(el, 'VisualizationEditor.Tabs.General')).toBeTruthy();
expect(elementExists(el, 'VisualizationEditor.Tabs.XAxis')).toBeTruthy();
expect(elementExists(el, 'VisualizationEditor.Tabs.YAxis')).toBeTruthy();
expect(elementExists(el, 'VisualizationEditor.Tabs.Series')).toBeTruthy();
expect(elementExists(el, 'VisualizationEditor.Tabs.Colors')).toBeTruthy();
expect(elementExists(el, 'VisualizationEditor.Tabs.DataLabels')).toBeTruthy();

expect(elementExists(el, 'Chart.GlobalSeriesType')).toBeTruthy(); // general settings block exists
expect(elementExists(el, 'Chart.Custom.Code')).toBeFalsy(); // custom settings block does not exist
Expand All @@ -42,12 +42,12 @@ describe('Visualizations -> Chart -> Editor (wrapper)', () => {
test('Renders wrapper for custom charts', () => {
const el = mount({ globalSeriesType: 'custom' }, { columns: [], rows: [] });

expect(elementExists(el, 'Chart.EditorTabs.General')).toBeTruthy();
expect(elementExists(el, 'Chart.EditorTabs.XAxis')).toBeFalsy();
expect(elementExists(el, 'Chart.EditorTabs.YAxis')).toBeFalsy();
expect(elementExists(el, 'Chart.EditorTabs.Series')).toBeFalsy();
expect(elementExists(el, 'Chart.EditorTabs.Colors')).toBeFalsy();
expect(elementExists(el, 'Chart.EditorTabs.DataLabels')).toBeFalsy();
expect(elementExists(el, 'VisualizationEditor.Tabs.General')).toBeTruthy();
expect(elementExists(el, 'VisualizationEditor.Tabs.XAxis')).toBeFalsy();
expect(elementExists(el, 'VisualizationEditor.Tabs.YAxis')).toBeFalsy();
expect(elementExists(el, 'VisualizationEditor.Tabs.Series')).toBeFalsy();
expect(elementExists(el, 'VisualizationEditor.Tabs.Colors')).toBeFalsy();
expect(elementExists(el, 'VisualizationEditor.Tabs.DataLabels')).toBeFalsy();

expect(elementExists(el, 'Chart.GlobalSeriesType')).toBeTruthy(); // general settings block exists
expect(elementExists(el, 'Chart.Custom.Code')).toBeTruthy(); // custom settings block exists
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"text": ["10 ± 0", "20 ± 0", "30 ± 0", "40 ± 0"],
"textposition": "inside",
"marker": { "color": "red" },
"insidetextfont": { "color": "#333333" },
"insidetextfont": { "color": "#ffffff" },
"yaxis": "y"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"text": ["20% (10 ± 0)", "40% (20 ± 0)", "60% (30 ± 0)", "80% (40 ± 0)"],
"textposition": "inside",
"marker": { "color": "red" },
"insidetextfont": { "color": "#333333" },
"insidetextfont": { "color": "#ffffff" },
"yaxis": "y"
},
{
Expand All @@ -73,7 +73,7 @@
"text": ["80% (40 ± 0)", "60% (30 ± 0)", "40% (20 ± 0)", "20% (10 ± 0)"],
"textposition": "inside",
"marker": { "color": "blue" },
"insidetextfont": { "color": "#333333" },
"insidetextfont": { "color": "#ffffff" },
"yaxis": "y"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"text": ["10 ± 0", "20 ± 0", "30 ± 0", "40 ± 0"],
"textposition": "inside",
"marker": { "color": "red" },
"insidetextfont": { "color": "#333333" },
"insidetextfont": { "color": "#ffffff" },
"yaxis": "y"
},
{
Expand All @@ -73,7 +73,7 @@
"text": ["1 ± 0", "2 ± 0", "3 ± 0", "4 ± 0"],
"textposition": "inside",
"marker": { "color": "blue" },
"insidetextfont": { "color": "#333333" },
"insidetextfont": { "color": "#ffffff" },
"yaxis": "y"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"error_y": { "array": [0, 0, 0, 0], "color": "red" },
"hover": [],
"text": ["10 ± 0", "20 ± 0", "30 ± 0", "40 ± 0"],
"insidetextfont": { "color": "#333333" },
"insidetextfont": { "color": "#ffffff" },
"yaxis": "y"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"error_y": { "array": [0, 0, 0, 0], "color": "red" },
"hover": [],
"text": ["10 ± 0", "20 ± 0", "30 ± 0", "40 ± 0"],
"insidetextfont": { "color": "#333333" },
"insidetextfont": { "color": "#ffffff" },
"yaxis": "y"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"hoverinfo": "text+x+name",
"hover": [],
"text": ["10 ± 0: 51", "20 ± 0: 52", "30 ± 0: 53", "40 ± 0: 54"],
"insidetextfont": { "color": "#333333" },
"insidetextfont": { "color": "#ffffff" },
"yaxis": "y"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"hover": [],
"text": ["10 ± 0", "20 ± 0", "30 ± 0", "40 ± 0"],
"marker": { "color": "red" },
"insidetextfont": { "color": "#333333" },
"insidetextfont": { "color": "#ffffff" },
"yaxis": "y"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"hover": [],
"text": ["10 ± 0", "20 ± 0", "30 ± 0", "40 ± 0"],
"marker": { "color": "red" },
"insidetextfont": { "color": "#333333" },
"insidetextfont": { "color": "#ffffff" },
"yaxis": "y"
},
{
Expand All @@ -69,7 +69,7 @@
"hover": [],
"text": ["", "2 ± 0", "", "4 ± 0"],
"marker": { "color": "blue" },
"insidetextfont": { "color": "#333333" },
"insidetextfont": { "color": "#ffffff" },
"yaxis": "y"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"hover": [],
"text": ["10 ± 0", "20 ± 0", "30 ± 0", "40 ± 0"],
"marker": { "color": "red" },
"insidetextfont": { "color": "#333333" },
"insidetextfont": { "color": "#ffffff" },
"yaxis": "y"
},
{
Expand All @@ -69,7 +69,7 @@
"hover": [],
"text": ["0", "2 ± 0", "0", "4 ± 0"],
"marker": { "color": "blue" },
"insidetextfont": { "color": "#333333" },
"insidetextfont": { "color": "#ffffff" },
"yaxis": "y"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"hover": [],
"text": ["20% (10 ± 0)", "40% (20 ± 0)", "60% (30 ± 0)", "80% (40 ± 0)"],
"marker": { "color": "red" },
"insidetextfont": { "color": "#333333" },
"insidetextfont": { "color": "#ffffff" },
"yaxis": "y"
},
{
Expand All @@ -71,7 +71,7 @@
"hover": [],
"text": ["80% (40 ± 0)", "60% (30 ± 0)", "40% (20 ± 0)", "20% (10 ± 0)"],
"marker": { "color": "blue" },
"insidetextfont": { "color": "#333333" },
"insidetextfont": { "color": "#ffffff" },
"yaxis": "y"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"hover": [],
"text": ["20% (10 ± 0)", "40% (20 ± 0)", "60% (30 ± 0)", "80% (40 ± 0)"],
"marker": { "color": "red" },
"insidetextfont": { "color": "#333333" },
"insidetextfont": { "color": "#ffffff" },
"yaxis": "y"
},
{
Expand All @@ -71,7 +71,7 @@
"hover": [],
"text": ["80% (40 ± 0)", "60% (30 ± 0)", "40% (20 ± 0)", "20% (10 ± 0)"],
"marker": { "color": "blue" },
"insidetextfont": { "color": "#333333" },
"insidetextfont": { "color": "#ffffff" },
"yaxis": "y"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"hover": [],
"text": ["10 ± 0", "20 ± 0", "30 ± 0", "40 ± 0"],
"marker": { "color": "red" },
"insidetextfont": { "color": "#333333" },
"insidetextfont": { "color": "#ffffff" },
"yaxis": "y"
},
{
Expand All @@ -71,7 +71,7 @@
"hover": [],
"text": ["1 ± 0", "2 ± 0", "3 ± 0", "4 ± 0"],
"marker": { "color": "blue" },
"insidetextfont": { "color": "#333333" },
"insidetextfont": { "color": "#ffffff" },
"yaxis": "y"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"hover": [],
"text": ["10 ± 0", "20 ± 0", "30 ± 0", "40 ± 0"],
"marker": { "color": "red" },
"insidetextfont": { "color": "#333333" },
"insidetextfont": { "color": "#ffffff" },
"yaxis": "y"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"hover": [],
"text": ["10 ± 0", "20 ± 0", "30 ± 0", "40 ± 0"],
"marker": { "color": "red" },
"insidetextfont": { "color": "#333333" },
"insidetextfont": { "color": "#ffffff" },
"yaxis": "y"
}
]
Expand Down
6 changes: 3 additions & 3 deletions client/cypress/integration/visualizations/choropleth_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('Choropleth', () => {
`);

cy.clickThrough(`
Choropleth.EditorTabs.General
VisualizationEditor.Tabs.General
Choropleth.Editor.MapType
Choropleth.Editor.MapType.Countries
Choropleth.Editor.KeyColumn
Expand All @@ -59,7 +59,7 @@ describe('Choropleth', () => {
Choropleth.Editor.ValueColumn.value
`);

cy.clickThrough('Choropleth.EditorTabs.Colors');
cy.clickThrough('VisualizationEditor.Tabs.Colors');
cy.clickThrough('Choropleth.Editor.Colors.Min');
cy.fillInputs({ 'ColorPicker.CustomColor': 'yellow{enter}' });
cy.wait(100); // eslint-disable-line cypress/no-unnecessary-waiting
Expand All @@ -71,7 +71,7 @@ describe('Choropleth', () => {
cy.wait(100); // eslint-disable-line cypress/no-unnecessary-waiting

cy.clickThrough(`
Choropleth.EditorTabs.Format
VisualizationEditor.Tabs.Format
Choropleth.Editor.LegendPosition
Choropleth.Editor.LegendPosition.TopRight
`);
Expand Down
6 changes: 3 additions & 3 deletions client/cypress/integration/visualizations/cohort_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ describe('Cohort', () => {
`);

cy.clickThrough(`
Cohort.EditorTabs.Options
VisualizationEditor.Tabs.Options
Cohort.TimeInterval
Cohort.TimeInterval.monthly
Cohort.Mode
Cohort.Mode.simple
Cohort.EditorTabs.Columns
VisualizationEditor.Tabs.Columns
Cohort.DateColumn
Cohort.DateColumn.date
Cohort.StageColumn
Expand All @@ -61,7 +61,7 @@ describe('Cohort', () => {
cy.percySnapshot('Visualizations - Cohort (simple)', { widths: [viewportWidth] });

cy.clickThrough(`
Cohort.EditorTabs.Options
VisualizationEditor.Tabs.Options
Cohort.Mode
Cohort.Mode.diagonal
`);
Expand Down
4 changes: 2 additions & 2 deletions client/cypress/integration/visualizations/counter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ describe('Counter', () => {
Counter.General.TargetValueColumn
Counter.General.TargetValueColumn.b
Counter.EditorTabs.Formatting
VisualizationEditor.Tabs.Format
`);

cy.fillInputs({
Expand Down Expand Up @@ -186,7 +186,7 @@ describe('Counter', () => {
Counter.General.TargetValueColumn
Counter.General.TargetValueColumn.b
Counter.EditorTabs.Formatting
VisualizationEditor.Tabs.Format
Counter.Formatting.FormatTargetValue
`);

Expand Down
4 changes: 2 additions & 2 deletions client/cypress/integration/visualizations/funnel_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('Funnel', () => {
`);

cy.clickThrough(`
Funnel.EditorTabs.General
VisualizationEditor.Tabs.General
Funnel.StepColumn
Funnel.StepColumn.a
Expand All @@ -64,7 +64,7 @@ describe('Funnel', () => {
cy.percySnapshot('Visualizations - Funnel (basic)', { widths: [viewportWidth] });

cy.clickThrough(`
Funnel.EditorTabs.Appearance
VisualizationEditor.Tabs.Appearance
`);

cy.fillInputs({
Expand Down
8 changes: 4 additions & 4 deletions client/cypress/integration/visualizations/map_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('Map (Markers)', () => {
`);

cy.clickThrough(`
Map.EditorTabs.General
VisualizationEditor.Tabs.General
Map.Editor.LatitudeColumnName
Map.Editor.LatitudeColumnName.lat
Map.Editor.LongitudeColumnName
Expand All @@ -42,7 +42,7 @@ describe('Map (Markers)', () => {
Map.Editor.GroupBy.country
`);

cy.clickThrough('Map.EditorTabs.Groups');
cy.clickThrough('VisualizationEditor.Tabs.Groups');
cy.clickThrough('Map.Editor.Groups.Israel.Color');
cy.fillInputs({ 'ColorPicker.CustomColor': 'red{enter}' });
cy.wait(100); // eslint-disable-line cypress/no-unnecessary-waiting
Expand All @@ -67,15 +67,15 @@ describe('Map (Markers)', () => {
`);

cy.clickThrough(`
Map.EditorTabs.General
VisualizationEditor.Tabs.General
Map.Editor.LatitudeColumnName
Map.Editor.LatitudeColumnName.lat
Map.Editor.LongitudeColumnName
Map.Editor.LongitudeColumnName.lng
`);

cy.clickThrough(`
Map.EditorTabs.Style
VisualizationEditor.Tabs.Style
Map.Editor.ClusterMarkers
Map.Editor.CustomizeMarkers
`);
Expand Down

0 comments on commit 70b9dc8

Please sign in to comment.