From 12f272d50721bdb344a4e2f19a4aecac899fc72b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Gir=C3=A3o=20Serr=C3=A3o?= <5621605+rodrigogiraoserrao@users.noreply.github.com> Date: Tue, 17 Jan 2023 14:56:35 +0000 Subject: [PATCH] Fix tests. I misread the original app hierarchy and was trying to focus something that can't be focused. --- tests/test_focus.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/tests/test_focus.py b/tests/test_focus.py index 7b96972e2..e782e8961 100644 --- a/tests/test_focus.py +++ b/tests/test_focus.py @@ -80,12 +80,10 @@ def test_focus_next_and_previous_with_type_selector(screen: Screen): screen.set_focus(screen.query_one("#Paul")) assert screen.focused.id == "Paul" - assert screen.focus_next(Focusable).id == "Jessica" assert screen.focus_next(Focusable).id == "baz" assert screen.focus_next(Focusable).id == "child" assert screen.focus_previous(Focusable).id == "baz" - assert screen.focus_previous(Focusable).id == "Jessica" assert screen.focus_previous(Focusable).id == "Paul" assert screen.focus_previous(Focusable).id == "container1" assert screen.focus_previous(Focusable).id == "foo" @@ -96,15 +94,12 @@ def test_focus_next_and_previous_with_str_selector(screen: Screen): screen.set_focus(screen.query_one("#foo")) assert screen.focused.id == "foo" - assert screen.focus_next(".a").id == "Jessica" - assert screen.focus_next("Focusable").id == "baz" - - assert screen.focus_previous(".b").id == "container1" - - assert screen.focus_next("Focusable").id == "Paul" + assert screen.focus_next(".a").id == "foo" + assert screen.focus_next(".c").id == "Paul" assert screen.focus_next(".c").id == "child" assert screen.focus_previous(".c").id == "Paul" + assert screen.focus_previous(".a").id == "foo" def test_focus_next_and_previous_with_type_selector_without_self(): @@ -162,6 +157,6 @@ def test_focus_next_and_previous_with_str_selector_without_self(screen: Screen): assert screen.focus_next(".b").id == "baz" assert screen.focus_next(".c").id == "child" - assert screen.focus_previous(".a").id == "Jessica" - assert screen.focus_previous(".b").id == "container1" assert screen.focus_previous(".a").id == "foo" + assert screen.focus_previous(".a").id == "foo" + assert screen.focus_previous(".b").id == "baz"