Skip to content

Commit

Permalink
chore: Add missing duplicateName test for user view
Browse files Browse the repository at this point in the history
  • Loading branch information
TatuJLund committed Oct 15, 2024
1 parent 261e684 commit 5e61db1
Showing 1 changed file with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public void addUser() {
assertEquals("Save conflict, try again.",
$(Notification.class).last().getCaption());
assertInitialState();
}
}

@SuppressWarnings("unchecked")
@Test
Expand All @@ -149,8 +149,8 @@ public void deleteUser() {
assertInitialState();
}

@SuppressWarnings("unchecked")
@Test
@SuppressWarnings("unchecked")
public void cancelForm() {
test($(ComboBox.class).id("user-select")).setInput("User1");
assertTrue($(FormLayout.class).single().isEnabled());
Expand All @@ -162,4 +162,23 @@ public void cancelForm() {

assertInitialState();
}

@Test
@SuppressWarnings("unchecked")
public void duplicateName() {
$(Button.class).id("new-button").click();

test($(TextField.class).id("user-field")).setValue("Super");
test($(PasswordField.class).id("password-field")).setValue("tester");
test($(PasswordField.class).id("password-repeat")).setValue("tester");
test($(ComboBox.class).id("role-field")).clickItem(Role.USER);

test($(Button.class).id("save-button")).click();

assertEquals("Username \"Super\" is a duplicate.",
$(Notification.class).last().getCaption());
$(Notification.class).last().close();

assertInitialState();
}
}

0 comments on commit 5e61db1

Please sign in to comment.