Add new failing test for #1743

This commit is contained in:
Jeff Epler 2023-12-15 10:24:45 -06:00
parent e819e97c29
commit 6f2b13bd5b
No known key found for this signature in database
GPG key ID: D5BF15AB975AB4DE

View file

@ -51,6 +51,18 @@ async def test_move_child_before_itself() -> None:
pilot.app.screen.move_child(child, before=child)
@pytest.mark.xfail(
strict=True, reason="https://github.com/Textualize/textual/issues/1743"
)
async def test_move_child_before_itself_numerically() -> None:
"""Test moving a widget before itself by numeric index."""
async with App().run_test() as pilot:
child = Widget(Widget())
await pilot.app.mount(child)
pilot.app.screen.move_child(child, before=0)
async def test_move_child_after_itself() -> None:
"""Test moving a widget after itself."""
# Regression test for https://github.com/Textualize/textual/issues/1743
@ -60,6 +72,18 @@ async def test_move_child_after_itself() -> None:
pilot.app.screen.move_child(child, after=child)
@pytest.mark.xfail(
strict=True, reason="https://github.com/Textualize/textual/issues/1743"
)
async def test_move_child_after_itself_numerically() -> None:
"""Test moving a widget after itself by numeric index."""
# Regression test for https://github.com/Textualize/textual/issues/1743
async with App().run_test() as pilot:
child = Widget(Widget())
await pilot.app.mount(child)
pilot.app.screen.move_child(child, after=0)
async def test_move_past_end_of_child_list() -> None:
"""Test attempting to move past the end of the child list."""
async with App().run_test() as pilot: