Skip to content

Commit 277f681

Browse files
committed
tests(chat-icon): Fix tests
1 parent da8803c commit 277f681

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tests/playwright/shiny/components/chat/icon/test_chat_icon.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,15 @@ def __init__(self, page: Page, id: str, classes: str):
1313

1414
def expect_last_message_icon_to_have_classes(self):
1515
# TODO: Fix this test to find icon in shadow root
16-
last_msg_icon = self.chat.loc_latest_message.locator(
17-
'.message-icon > slot[name="icon"] > *'
18-
)
16+
if self.id == "default":
17+
last_msg_icon = self.chat.loc_latest_message.locator(
18+
'slot[name="icon"] > :first-child'
19+
)
20+
else:
21+
last_msg_icon = self.chat.loc_latest_message.locator(
22+
'[slot="icon"]'
23+
)
24+
1925
expect(last_msg_icon).to_have_class(self.classes)
2026

2127

0 commit comments

Comments
 (0)