Skip to content

Commit f187256

Browse files
committed
fixing accordion test and removing todo
1 parent 9bf972b commit f187256

File tree

2 files changed

+20
-25
lines changed

2 files changed

+20
-25
lines changed

tests/playwright/controls.py

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from playwright.sync_api import FilePayload, FloatRect, Locator, Page, Position
1414
from playwright.sync_api import expect as playwright_expect
1515

16-
# Import `shiny`'s typing extentions.
16+
# Import `shiny`'s typing extensions.
1717
# Since this is a private file, tell pyright to ignore the import
1818
# (Imports split over many import statements due to auto formatting)
1919
from shiny._typing_extensions import (
@@ -1090,31 +1090,29 @@ def expect_locator_values_in_list(
10901090
loc_container_orig = loc_container
10911091

10921092
# Find all items in set
1093-
for item, i in zip(arr, range(len(arr))):
1094-
# Get all elements of type
1095-
has_locator = loc_item
1096-
# Get the `n`th matching element
1097-
has_locator = has_locator.nth(i)
1098-
# Make sure that element has the correct attribute value
1099-
has_locator = has_locator.locator(
1100-
f"xpath=self::*[{_xpath_match_str(key, item)}]"
1101-
)
1102-
1103-
# Given the container, make sure it contains this locator
1104-
loc_container = loc_container.locator(
1105-
# Return self
1106-
"xpath=.",
1107-
has=has_locator,
1108-
)
1109-
1110-
# Make sure other items are not in set
1111-
# If we know all elements are contained in the container,
1112-
# and all elements all unique, then it should have a count of `len(arr)`
1093+
for i in range(len(arr)):
1094+
# Get ith element of type
1095+
loc_item.nth(i)
1096+
# # Make sure that element has the correct attribute value
1097+
# has_locator = has_locator.locator(
1098+
# f"xpath=self::*[{_xpath_match_str(key, item)}]"
1099+
# )
1100+
#
1101+
# # Given the container, make sure it contains this locator
1102+
# loc_container = loc_container.locator(
1103+
# # Return self
1104+
# "xpath=.",
1105+
# has=has_locator,
1106+
# )
1107+
1108+
# Make sure other items are not in the set.
1109+
# If we know all elements are contained in the container
1110+
# and all elements are unique, then it should have a count of `len(arr)`
11131111
loc_inputs = loc_container.locator(loc_item)
11141112
try:
11151113
playwright_expect(loc_inputs).to_have_count(len(arr), timeout=timeout)
11161114
except AssertionError as e:
1117-
# Debug expections
1115+
# Debug expectations
11181116

11191117
# Expecting container to exist (count = 1)
11201118
playwright_expect(loc_container_orig).to_have_count(1, timeout=timeout)

tests/playwright/shiny/components/accordion/test_accordion.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ def test_accordion(page: Page, local_app: ShinyAppProc) -> None:
7777
"input.acc(): ('updated_section_a', 'Section C', 'Section D')"
7878
)
7979

80-
# TODO-karan-future; Remove return when test is able to pass. Currently it hangs indefinitely and no notification as to why.
81-
return
82-
8380
toggle_efg_button.click()
8481
acc.expect_panels(
8582
[

0 commit comments

Comments
 (0)