Skip to content
Snippets Groups Projects
Commit 08c078b3 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

Fixed #648 - chart page: fixed display behaviour of filter badge:

The filter badge is now correctly displayed if a chart is displayed with active filters and the button to show the chart settings is clicked.
parent 76be3bbc
No related branches found
No related tags found
No related merge requests found
Pipeline #5401 passed
...@@ -115,6 +115,7 @@ $(document).ready(function() ...@@ -115,6 +115,7 @@ $(document).ready(function()
document.getElementsByName('NewChartSettings')[0].classList.toggle('hidden', false); document.getElementsByName('NewChartSettings')[0].classList.toggle('hidden', false);
document.getElementById('buttonShowChartSettings').classList.toggle('hidden', true); document.getElementById('buttonShowChartSettings').classList.toggle('hidden', true);
applyFilter();
checkShowChartButton(); checkShowChartButton();
}); });
......
...@@ -267,6 +267,36 @@ class ChartTest extends SeleniumTestBase ...@@ -267,6 +267,36 @@ class ChartTest extends SeleniumTestBase
assertThat(driver.findElement(By.id("filterActiveBadge")).isDisplayed()).isFalse(); assertThat(driver.findElement(By.id("filterActiveBadge")).isDisplayed()).isFalse();
} }
@Test
void test_showFilterBadgeOnShowChartSettings()
{
driver.get(helper.getUrl() + "/charts");
final String chartPreviewSelector = ".chart-preview-column[data-id='6']";
driver.findElement(By.cssSelector(chartPreviewSelector)).click();
WebDriverWait wait = new WebDriverWait(driver, 5);
wait.until(ExpectedConditions.attributeContains(By.cssSelector(chartPreviewSelector + " .chart-preview"), "class", "active"));
driver.findElement(By.id("chart-filter-container")).click();
driver.findElement(By.id("section-type")).click();
final WebElement checkBox = driver.findElement(By.cssSelector("#section-type .text-default"));
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", checkBox);
checkBox.click();
driver.findElement(By.name("buttonSave")).click();
wait = new WebDriverWait(driver, 5);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.className("chart-canvas")));
driver.findElement(By.id("buttonShowChartSettings")).click();
wait = new WebDriverWait(driver, 5);
wait.until(ExpectedConditions.attributeContains(By.cssSelector(chartPreviewSelector + " .chart-preview"), "class", "active"));
assertThat(driver.findElement(By.id("filterActiveBadge")).isDisplayed()).isTrue();
}
@Test @Test
void test_showManageButtonForCustomCharts() void test_showManageButtonForCustomCharts()
{ {
...@@ -304,7 +334,7 @@ class ChartTest extends SeleniumTestBase ...@@ -304,7 +334,7 @@ class ChartTest extends SeleniumTestBase
} }
@Test @Test
void test_EnabledButtonAfterShowChart() void test_enabledButtonAfterShowChart()
{ {
driver.get(helper.getUrl() + "/charts"); driver.get(helper.getUrl() + "/charts");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment