Skip to content

Commit 350f9d2

Browse files
committed
Update tooltip options test for HTML entity encoding
Modified the test to check for JSON keys encoded as HTML entities (e.g., "offset") instead of plain double quotes, reflecting the actual output format.
1 parent 4e1a7cc commit 350f9d2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tests/pytest/test_ui.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import json
21
import textwrap
32

43
from htmltools import HTMLDocument, TagList, tags
@@ -208,9 +207,9 @@ def test_tooltip_options():
208207

209208
# Should contain bsOptions attribute with JSON-encoded options
210209
assert "bsoptions" in t_str.lower(), "bsOptions attribute should be present"
211-
# Check that the JSON content is present (with or without spaces after separators)
212-
assert (
213-
'"offset"' in t_str and ("[0, 100]" in t_str or "[0,100]" in t_str)
210+
# Check that the JSON content is present (HTML entities are encoded, so " becomes ")
211+
assert ""offset"" in t_str and (
212+
"[0, 100]" in t_str or "[0,100]" in t_str
214213
), "Options should be JSON-encoded with offset value"
215214

216215
# Test without options parameter

0 commit comments

Comments
 (0)