validate password in the frontend too (#2017)

This commit is contained in:
Athou
2026-01-15 09:44:57 +01:00
parent eb573fdc8b
commit 5a95b95801
36 changed files with 223 additions and 125 deletions

View File

@@ -6,7 +6,6 @@ import org.junit.jupiter.api.Test;
import com.commafeed.TestConstants;
import com.microsoft.playwright.BrowserContext;
import com.microsoft.playwright.Locator;
import com.microsoft.playwright.Page;
import com.microsoft.playwright.assertions.PlaywrightAssertions;
import com.microsoft.playwright.options.AriaRole;
@@ -48,17 +47,6 @@ class AuthentificationIT {
PlaywrightAssertions.assertThat(page).hasURL("http://localhost:8085/#/app/category/all");
}
@Test
void registerFailPasswordTooSimple() {
Page page = context.newPage();
page.navigate(getLoginPageUrl());
page.getByText("Sign up!").click();
PlaywrightTestUtils.register(page, "user", "user@domain.com", "p");
Locator alert = page.getByRole(AriaRole.ALERT);
PlaywrightAssertions.assertThat(alert).containsText("Password must be 4 or more characters in length.");
}
@Test
void registerSuccess() {
Page page = context.newPage();

View File

@@ -22,6 +22,7 @@ class ServerIT extends BaseIT {
Assertions.assertEquals(900000, serverInfos.getWebsocketPingInterval());
Assertions.assertEquals(30000, serverInfos.getTreeReloadInterval());
Assertions.assertEquals(60000, serverInfos.getForceRefreshCooldownDuration());
Assertions.assertEquals(4, serverInfos.getMinimumPasswordLength());
}
}