fix(tests): update mock from inner_text() to text_content() in e2e helpers
All checks were successful
CI / test (push) Successful in 45s
All checks were successful
CI / test (push) Successful in 45s
get_page_errors() was switched to text_content() to capture errors in CSS-hidden elements (collapsed Streamlit expanders). Two unit test mocks still stubbed inner_text() — causing CI failures because MagicMock() returned a non-string from text_content(), breaking the "boom" in message content assertion.
This commit is contained in:
parent
8d9c5782fd
commit
aa92bc1e5b
1 changed files with 2 additions and 3 deletions
|
|
@ -116,8 +116,7 @@ def test_get_page_errors_finds_exceptions(monkeypatch):
|
|||
from tests.e2e.conftest import get_page_errors
|
||||
|
||||
mock_el = MagicMock()
|
||||
mock_el.get_attribute.return_value = None
|
||||
mock_el.inner_text.return_value = "RuntimeError: boom"
|
||||
mock_el.text_content.return_value = "RuntimeError: boom"
|
||||
mock_el.inner_html.return_value = "<div>RuntimeError: boom</div>"
|
||||
|
||||
mock_page = MagicMock()
|
||||
|
|
@ -138,7 +137,7 @@ def test_get_page_errors_finds_alert_errors(monkeypatch):
|
|||
mock_child = MagicMock()
|
||||
mock_el = MagicMock()
|
||||
mock_el.query_selector.return_value = mock_child
|
||||
mock_el.inner_text.return_value = "Something went wrong"
|
||||
mock_el.text_content.return_value = "Something went wrong"
|
||||
mock_el.inner_html.return_value = "<div>Something went wrong</div>"
|
||||
|
||||
mock_page = MagicMock()
|
||||
|
|
|
|||
Loading…
Reference in a new issue