Skip to content

Commit

Permalink
fix formatting and spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
falkoschindler committed Dec 4, 2024
1 parent e168cf2 commit 6efd247
Showing 1 changed file with 21 additions and 24 deletions.
45 changes: 21 additions & 24 deletions tests/test_user_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,43 +420,40 @@ async def test_trigger_autocomplete(user: User) -> None:
user.find('fruit').type('a').trigger('keydown.tab')
await user.should_see('apple')

async def test_should_see_on_invisible_element(user: User) -> None:
lable = ui.label('Hello')
lable.visible = False

await user.open('/')
with pytest.raises(AssertionError):
await user.should_see('Hello')
lable.visible = True
await user.should_see('Hello')


async def test_should_not_see_on_invisible_element(user: User) -> None:
lable = ui.label('Hello')
lable.visible = True
async def test_seeing_invisible_elements(user: User) -> None:
visible_label = ui.label('Visible')
hidden_label = ui.label('Hidden')
hidden_label.visible = False

await user.open('/')
with pytest.raises(AssertionError):
await user.should_not_see('Hello')
lable.visible = False
await user.should_not_see('Hello')
await user.should_see('Hidden')
with pytest.raises(AssertionError):
await user.should_not_see('Visible')

visible_label.visible = False
hidden_label.visible = True
await user.should_see('Hidden')
await user.should_not_see('Visible')

async def test_find_on_invisible_element(user: User) -> None:

async def test_finding_invisible_elements(user: User) -> None:
button = ui.button('click me', on_click=lambda: ui.label('clicked'))
button.visible = False

await user.open('/')
with pytest.raises(AssertionError):
user.find('click me').click()

button.visible = True
user.find('click me').click()
await user.should_see('clicked')

async def test_page_to_sting_output_with_hidden_elements(user: User) -> None:
ui.label("Hello")
hidden_label = ui.label("Hidden Label")
hidden_label.visible = False

async def test_page_to_string_output_for_invisible_elements(user: User) -> None:
ui.label('Visible')
ui.label('Hidden').set_visibility(False)

await user.open('/')
output = str(user.current_layout)
Expand All @@ -465,6 +462,6 @@ async def test_page_to_sting_output_with_hidden_elements(user: User) -> None:
q-page-container
q-page
div
Label [text=Hello]
Label [text=Hidden Label, visible=False]
'''.strip()
Label [text=Visible]
Label [text=Hidden, visible=False]
'''.strip()

0 comments on commit 6efd247

Please sign in to comment.