From 61c810a141ca4fe84a2db75f53582d71358d1782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Carrasco=20Mo=C3=B1ino?= Date: Fri, 8 Sep 2023 12:26:31 +0200 Subject: [PATCH] removing loginForm_isLumoThemed test that makes not sense anymore (#281) --- .../org/vaadin/example/AbstractViewTest.java | 23 ------------------- .../example/authentication/LoginScreenIT.java | 6 ----- 2 files changed, 29 deletions(-) diff --git a/src/test/java/org/vaadin/example/AbstractViewTest.java b/src/test/java/org/vaadin/example/AbstractViewTest.java index c5d8e95..0b4176d 100644 --- a/src/test/java/org/vaadin/example/AbstractViewTest.java +++ b/src/test/java/org/vaadin/example/AbstractViewTest.java @@ -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 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. */ diff --git a/src/test/java/org/vaadin/example/authentication/LoginScreenIT.java b/src/test/java/org/vaadin/example/authentication/LoginScreenIT.java index a3780a1..2322f19 100644 --- a/src/test/java/org/vaadin/example/authentication/LoginScreenIT.java +++ b/src/test/java/org/vaadin/example/authentication/LoginScreenIT.java @@ -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() {