forked from zauberzeug/nicegui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
introduce group.remove(element) zauberzeug#145
- Loading branch information
1 parent
682fd6c
commit b917f00
Showing
5 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from nicegui import ui | ||
|
||
from .screen import Screen | ||
|
||
|
||
def test_remove_and_clear(screen: Screen): | ||
with ui.row() as row: | ||
ui.label('Label A') | ||
b = ui.label('Label B') | ||
ui.label('Label C') | ||
|
||
ui.button('Remove B', on_click=lambda: row.remove(b)) | ||
ui.button('Remove 0', on_click=lambda: row.remove(0)) | ||
ui.button('Clear', on_click=lambda: row.clear()) | ||
|
||
screen.open('/') | ||
screen.should_contain('Label A') | ||
screen.should_contain('Label B') | ||
screen.should_contain('Label C') | ||
|
||
screen.click('Remove B') | ||
screen.should_contain('Label A') | ||
screen.should_not_contain('Label B') | ||
screen.should_contain('Label C') | ||
|
||
screen.click('Remove 0') | ||
screen.should_not_contain('Label A') | ||
screen.should_not_contain('Label B') | ||
screen.should_contain('Label C') | ||
|
||
screen.click('Clear') | ||
screen.should_not_contain('Label A') | ||
screen.should_not_contain('Label B') | ||
screen.should_not_contain('Label C') |