Open TomJGooding opened 2 hours ago
I created a similar snapshot test while trying to fix this, but strangely that looks as expected before any changes?
EDIT: Hm, do I need to add pilot.pause()
before removing the tab?
def test_tabs_updates_highlighting_when_tab_removed(snap_compare):
"""Regression test for https://github.com/Textualize/textual/issues/5218"""
class TabsApp(App):
def compose(self) -> ComposeResult:
yield Tabs(
Tab("foo", id="foo"),
Tab("bar", id="bar"),
active="bar",
)
async def run_before(pilot: Pilot):
pilot.app.query_one(Tabs).remove_tab("foo")
app = TabsApp()
assert snap_compare(app, run_before=run_before)
Originally posted in https://github.com/Textualize/textual/issues/5215#issuecomment-2462555201, but this is actually an issue with
Tabs
whereremove_tab
does not update the highlighting.