Consolidate pytest.ini with pyproject.toml & add test
Some checks failed
Run Tests / run-tests (push) Failing after 1m6s
Build & Release / build-docker-image (push) Successful in 4m35s
Build & Release / deploy-to-production (push) Successful in 25s

This commit is contained in:
2026-04-25 13:04:03 +02:00
parent 545841561f
commit 89125782d7
4 changed files with 41 additions and 18 deletions

View File

@@ -7,6 +7,7 @@ def test_initial_state(app):
assert not app.error
assert len(app.header) == 0 # No counter currently present
def test_add_counter(app):
app.run()
@@ -31,6 +32,7 @@ def test_add_counter(app):
assert len(app.header) == 1 # A new counter was added
assert app.header[0].value == ":material/calendar_clock: Walk"
def test_remove_counter(app):
# Create a counter to remove
@@ -57,3 +59,20 @@ def test_remove_counter(app):
app.run()
assert len(app.header) == 0 # No counter exists
def test_increment_counter(app):
# Create a counter to increment
queries.crud.create_counter("Remove me", CounterType.SIMPLE, "020122")
app.run()
assert not app.exception
assert not app.error
assert len(app.header) == 1 # One counter exists
assert "0 times" in app.markdown[0].value # Counter is 0
app.button(key="increment_counter_1").click().run()
assert "1 times" in app.markdown[0].value # Counter is 1