Skip to content

Commit

Permalink
Fix one instance of test flakiness
Browse files Browse the repository at this point in the history
  • Loading branch information
Archmonger committed Dec 11, 2024
1 parent 90a6308 commit 0b593a5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_app/tests/test_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,8 @@ def test_model_form(self):
self.page.wait_for_selector(".errorlist")

# Submitting an empty form should result in 1 error element.
assert len(self.page.query_selector_all(".errorlist")) == 1
error_list = self.page.locator(".errorlist").all()
assert len(error_list) == 1

# Fill out the form
self.page.locator("#id_text").type(uuid, delay=CLICK_DELAY)
Expand All @@ -800,7 +801,7 @@ def test_model_form(self):
self.page.wait_for_selector("input[type=submit]").click(delay=CLICK_DELAY)

# Wait for the error message to disappear (indicating that the form has been re-rendered)
expect(self.page.locator(".errorlist").all()[0]).not_to_be_attached()
expect(error_list[0]).not_to_be_attached()

# Make sure no errors remain
assert len(self.page.query_selector_all(".errorlist")) == 0
Expand Down

0 comments on commit 0b593a5

Please sign in to comment.