Prevent reactive-watcher loop in Tabs / TabbedContent. (#2305)

* Add regression test for #2229.

* Fix potential reactive-watch loop.

* Simplify regression test.

Labels are cheaper to use and the final visual result of the test won't depend on the directory it runs from.

* Simplify solution.

Turns out I didn't need a descriptor. :(

* Fail on empty tab.
This commit is contained in:
Rodrigo Girão Serrão
2023-04-18 11:48:33 +01:00
committed by GitHub
parent 3a7cf08ef2
commit 66a644845b
5 changed files with 196 additions and 20 deletions

View File

@@ -431,3 +431,8 @@ def test_scroll_to_center(snap_compare):
# scrolled so that the red string >>bullseye<< is centered on the screen.
# When this snapshot "breaks" because #2254 is fixed, this snapshot can be updated.
assert snap_compare(SNAPSHOT_APPS_DIR / "scroll_to_center.py", press=["s"])
def test_quickly_change_tabs(snap_compare):
# https://github.com/Textualize/textual/issues/2229
assert snap_compare(SNAPSHOT_APPS_DIR / "quickly_change_tabs.py", press=["p"])