Skip to content

Commit

Permalink
Update selector
Browse files Browse the repository at this point in the history
  • Loading branch information
raethlein committed May 6, 2024
1 parent c5eacf1 commit 2f34733
Show file tree
Hide file tree
Showing 72 changed files with 25 additions and 25 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 22 additions & 22 deletions e2e_playwright/st_heading_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,22 +144,23 @@ def test_headers_hovered_snapshot_match(
):
headers = _get_header_elements(themed_app)
header = headers.nth(0)
link_container = header.get_by_test_id("stHeaderActionElements").locator("a")
expect(link_container).to_have_css("visibility", "hidden")
header.hover()
link_container = header.get_by_test_id("StyledLinkIconContainer")
expect(link_container).to_have_css("opacity", "1")
assert_snapshot(link_container, name="st_header-hover_with_visible_anchor")
expect(link_container).to_have_css("visibility", "visible")
assert_snapshot(header, name="st_header-hover_with_visible_anchor")

header = headers.nth(3)
link_container = header.get_by_test_id("stHeaderActionElements").locator("a")
expect(link_container).to_have_css("visibility", "hidden")
header.hover()
link_container = header.get_by_test_id("StyledLinkIconContainer")
expect(link_container).to_have_css("opacity", "1")
assert_snapshot(link_container, name="st_header-hover_with_help_and_anchor")
expect(link_container).to_have_css("visibility", "visible")
assert_snapshot(header, name="st_header-hover_with_help_and_anchor")

header = headers.nth(4)
header.hover()
link_container = header.get_by_test_id("StyledLinkIconContainer")
expect(link_container).to_have_css("opacity", "1")
assert_snapshot(link_container, name="st_header-hover_with_help_and_hidden_anchor")
link_container = header.get_by_test_id("stHeaderActionElements").locator("a")
expect(link_container).not_to_be_attached()
assert_snapshot(header, name="st_header-hover_with_help_and_hidden_anchor")


def test_subheaders_snapshot_match(
Expand All @@ -176,24 +177,23 @@ def test_subheaders_hovered_snapshot_match(
):
headers = _get_subheader_elements(themed_app)
header = headers.nth(0)
link_container = header.get_by_test_id("stHeaderActionElements").locator("a")
expect(link_container).to_have_css("visibility", "hidden")
header.hover()
link_container = header.get_by_test_id("StyledLinkIconContainer")
expect(link_container).to_have_css("opacity", "1")
assert_snapshot(link_container, name="st_subheader-hover_with_visible_anchor")
expect(link_container).to_have_css("visibility", "visible")
assert_snapshot(header, name="st_subheader-hover_with_visible_anchor")

header = headers.nth(5)
link_container = header.get_by_test_id("stHeaderActionElements").locator("a")
expect(link_container).to_have_css("visibility", "hidden")
header.hover()
link_container = header.get_by_test_id("StyledLinkIconContainer")
expect(link_container).to_have_css("opacity", "1")
assert_snapshot(link_container, name="st_subheader-hover_with_help_and_anchor")
expect(link_container).to_have_css("visibility", "visible")
assert_snapshot(header, name="st_subheader-hover_with_help_and_anchor")

header = headers.nth(6)
header.hover()
link_container = header.get_by_test_id("StyledLinkIconContainer")
expect(link_container).to_have_css("opacity", "1")
assert_snapshot(
link_container, name="st_subheader-hover_with_help_and_hidden_anchor"
)
link_container = header.get_by_test_id("stHeaderActionElements").locator("a")
expect(link_container).not_to_be_attached()
assert_snapshot(header, name="st_subheader-hover_with_help_and_hidden_anchor")


def test_links_are_rendered_correctly_snapshot(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ describe("StreamlitMarkdown", () => {
</IsSidebarContext.Provider>
)
expect(
screen.queryByTestId("stStyledHeadingWithActionElements=1")
screen.queryByTestId("stStyledHeadingWithActionElements")
).not.toBeInTheDocument()
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@ export const StyledHeadingWithActionElements = styled.div(({ theme }) => ({
// we use opacity instead of visibility because the react-testing-library seems
// to have issues with queryByRole('link') otherwise, even when triggering hover-events
"& .stHeaderActionElements > a": {
opacity: 0,
visibility: "hidden",
},
":hover": {
"& .stHeaderActionElements > a": {
opacity: 1,
visibility: "visible",
},
},
}))
Expand Down

0 comments on commit 2f34733

Please sign in to comment.