Skip to content

Commit

Permalink
test validation
Browse files Browse the repository at this point in the history
  • Loading branch information
mccalluc committed Jan 10, 2025
1 parent cc29e39 commit 872de3c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ def expect_no_error():
# Now upload:
csv_path = Path(__file__).parent / "fixtures" / "fake.csv"
page.get_by_label("Choose CSV file").set_input_files(csv_path.resolve())

# Check validation of contributions:
# Playwright itself won't let us fill non-numbers in this field.
# "assert define_analysis_button.is_enabled()" has spurious errors.
page.get_by_label("Contributions").fill("0")
expect_visible("Contributions must be 1 or greater")
expect_visible("Choose CSV and Contributions before proceeding")

page.get_by_label("Contributions").fill("42")
expect_not_visible("Contributions must be 1 or greater")
expect_not_visible("Choose CSV and Contributions before proceeding")

expect_no_error()

# -- Define analysis --
Expand Down

0 comments on commit 872de3c

Please sign in to comment.