summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSauli Tähkäpää <sauli@vaadin.com>2014-11-01 14:04:39 +0200
committerSauli Tähkäpää <sauli@vaadin.com>2014-11-10 13:15:44 +0200
commitef8d1ecf8765ce68bbe69021b90f3377ef8d201a (patch)
tree363c5d24376af737440fd505af4ce842553ba8e0
parent5b76975df4216f48710476b44f1013bbed47f6d2 (diff)
downloadvaadin-framework-ef8d1ecf8765ce68bbe69021b90f3377ef8d201a.tar.gz
vaadin-framework-ef8d1ecf8765ce68bbe69021b90f3377ef8d201a.zip
Reverse asc and desc table sorting indicators for Valo. (#15123)
Change-Id: If649d7ab0b4257cfaa1488dfff88afa8ef122f67
-rw-r--r--WebContent/VAADIN/themes/valo/components/_table.scss4
-rw-r--r--uitest/src/com/vaadin/tests/themes/valo/TableSortIndicator.java34
-rw-r--r--uitest/src/com/vaadin/tests/themes/valo/TableSortIndicatorTest.java46
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