diff options
author | Sauli Tähkäpää <sauli@vaadin.com> | 2014-11-01 14:04:39 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-11-03 10:11:46 +0000 |
commit | dda24122a7a0a0491fc5cac69792fe37a826803e (patch) | |
tree | 46dd4a4e9e2298a0a0976d5c6f418f464a2673d4 | |
parent | 77bb7ac886bd9f82e5295323254cd9fbb8ea8a10 (diff) | |
download | vaadin-framework-dda24122a7a0a0491fc5cac69792fe37a826803e.tar.gz vaadin-framework-dda24122a7a0a0491fc5cac69792fe37a826803e.zip |
Reverse asc and desc table sorting indicators for Valo. (#15123)
Change-Id: If649d7ab0b4257cfaa1488dfff88afa8ef122f67
3 files changed, 82 insertions, 2 deletions
diff --git a/WebContent/VAADIN/themes/valo/components/_table.scss b/WebContent/VAADIN/themes/valo/components/_table.scss index d8a673294d..a70532ccfd 100644 --- a/WebContent/VAADIN/themes/valo/components/_table.scss +++ b/WebContent/VAADIN/themes/valo/components/_table.scss @@ -612,7 +612,7 @@ $v-table-background-color: null !default; * @group table */ @mixin valo-table-sort-asc-icon-style { - content: '\f0dd'; + content: '\f0de'; font-family: FontAwesome; } @@ -623,7 +623,7 @@ $v-table-background-color: null !default; * @group table */ @mixin valo-table-sort-desc-icon-style { - content: '\f0de'; + content: '\f0dd'; font-family: FontAwesome; } diff --git a/uitest/src/com/vaadin/tests/themes/valo/TableSortIndicator.java b/uitest/src/com/vaadin/tests/themes/valo/TableSortIndicator.java new file mode 100644 index 0000000000..74e5fcd0ef --- /dev/null +++ b/uitest/src/com/vaadin/tests/themes/valo/TableSortIndicator.java @@ -0,0 +1,34 @@ +package com.vaadin.tests.themes.valo; + +import com.vaadin.annotations.*; +import com.vaadin.server.*; +import com.vaadin.tests.components.*; +import com.vaadin.ui.*; + +@Theme("valo") +public class TableSortIndicator extends AbstractTestUI { + @Override + protected void setup(VaadinRequest request) { + Table table = new Table(); + table.addContainerProperty("Index", Integer.class, ""); + + for(int i=0;i<10;i++) { + table.addItem(new Object[] {i}, i); + } + + table.setPageLength(0); + + addComponent(table); + } + + @Override + protected String getTestDescription() { + return "For Valo, sorting indicators should point up when sorted asc " + + "and down when sorted desc."; + } + + @Override + protected Integer getTicketNumber() { + return 15123; + } +} diff --git a/uitest/src/com/vaadin/tests/themes/valo/TableSortIndicatorTest.java b/uitest/src/com/vaadin/tests/themes/valo/TableSortIndicatorTest.java new file mode 100644 index 0000000000..42f0b2aeae --- /dev/null +++ b/uitest/src/com/vaadin/tests/themes/valo/TableSortIndicatorTest.java @@ -0,0 +1,46 @@ +package com.vaadin.tests.themes.valo; + +import com.vaadin.testbench.By; +import com.vaadin.tests.tb3.*; +import org.junit.*; +import org.openqa.selenium.*; + +import java.io.*; + +public class TableSortIndicatorTest extends MultiBrowserTest { + + private void clickOnCellHeader() { + clickElementByClass("v-table-header-cell"); + } + + @Test + public void ascendingIndicatorIsShown() throws IOException { + openTestURL(); + + clickOnCellHeader(); + + compareScreen("ascending"); + } + + @Test + public void descendingIndicatorIsShown() throws IOException { + openTestURL(); + + clickOnCellHeader(); + clickOnSortIndicator(); + + compareScreen("descending"); + } + + private void clickOnSortIndicator() { + clickElementByClass("v-table-sort-indicator"); + } + + private void clickElementByClass(String className) { + findElementByClass(className).click(); + } + + private WebElement findElementByClass(String className) { + return driver.findElement(By.className(className)); + } +}
\ No newline at end of file |