Consolidate pytest.ini with pyproject.toml & add test
Some checks failed
Run Tests / run-tests (push) Failing after 29s
Some checks failed
Run Tests / run-tests (push) Failing after 29s
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user