Skip to content

Commit

Permalink
removing loginForm_isLumoThemed test that makes not sense anymore (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
manolo authored Sep 8, 2023
1 parent 065fcf2 commit 61c810a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
23 changes: 0 additions & 23 deletions src/test/java/org/vaadin/example/AbstractViewTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,29 +71,6 @@ protected WebElement getRootElement() {
return findElement(rootSelector);
}

/**
* Asserts that the given {@code element} is rendered using a theme
* identified by {@code themeClass}. If the theme is not found, JUnit
* assert will fail the test case.
*
* @param element web element to check for the theme
* @param themeClass theme class (such as {@code Lumo.class}
*/
protected void assertThemePresentOnElement(
WebElement element, Class<? extends AbstractTheme> themeClass) {
String themeName = themeClass.getSimpleName().toLowerCase();
Boolean hasStyle = (Boolean) executeScript("" +
"var styles = Array.from(arguments[0]._template.content" +
".querySelectorAll('style'))" +
".filter(style => style.textContent.indexOf('" +
themeName + "') > -1);" +
"return styles.length > 0;", element);

Assert.assertTrue("Element '" + element.getTagName() + "' should have" +
" had theme '" + themeClass.getSimpleName() + "'.",
hasStyle);
}

/**
* Property set to true when running on a test hub.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@

public class LoginScreenIT extends AbstractViewTest {

@Test
public void loginForm_isLumoThemed() {
final LoginFormElement loginForm = $(LoginFormElement.class).first();
assertThemePresentOnElement(loginForm, Lumo.class);
}

@Test
public void loginAsAdmin_hasAdminViewLink() {

Expand Down

0 comments on commit 61c810a

Please sign in to comment.