* @group table
*/
@mixin valo-table-sort-asc-icon-style {
- content: '\f0dd';
+ content: '\f0de';
font-family: FontAwesome;
}
* @group table
*/
@mixin valo-table-sort-desc-icon-style {
- content: '\f0de';
+ content: '\f0dd';
font-family: FontAwesome;
}
--- /dev/null
+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;
+ }
+}
--- /dev/null
+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