Skip to content

Commit

Permalink
Merge pull request #53 from ikerreyes/chip-vs-chip-group
Browse files Browse the repository at this point in the history
Update CHIP_ROOT to exclude groups
  • Loading branch information
mshriver authored Feb 28, 2024
2 parents e0cae05 + 1c44d39 commit 3e5a789
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/widgetastic_patternfly5/components/chip.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ def __init__(self, chip, message):
self.chip = chip


CHIP_ROOT = ".//div[contains(@class, '-c-chip') and not(contains(@class, '-m-overflow'))]"
CHIP_ROOT = (
".//div[contains(@class, '-c-chip') and not(contains(@class, '-m-overflow')) "
"and not(contains(@class, '-c-chip-group'))]"
)
CHIP_TEXT = ".//span[contains(@class, '-c-chip__text')]"
CHIP_BADGE = ".//span[contains(@class, '-c-badge')]"
GROUP_ROOT = ".//div[contains(@class, '-c-chip-group__main')]"
Expand Down
3 changes: 3 additions & 0 deletions testing/components/test_chip.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ def test_chipgroup_category(category_chip_group_view):
assert category_chip_group_view.category_one.is_displayed
assert category_chip_group_view.category_one.label == "Category one"

chips = ["Chip one", "Chip two", "Chip three"]
assert category_chip_group_view.category_one.read() == chips

category_chip_group_view.category_one.close()
assert not category_chip_group_view.category_one.is_displayed

Expand Down

0 comments on commit 3e5a789

Please sign in to comment.