fix unit tests
This commit is contained in:
parent
3265c02838
commit
77a661b773
@ -1299,21 +1299,23 @@ def test_app_wrap_compile_theme(
|
|||||||
app_js_lines = [
|
app_js_lines = [
|
||||||
line.strip() for line in app_js_contents.splitlines() if line.strip()
|
line.strip() for line in app_js_contents.splitlines() if line.strip()
|
||||||
]
|
]
|
||||||
|
lines = "".join(app_js_lines)
|
||||||
assert (
|
assert (
|
||||||
"function AppWrap({children}) {"
|
"function AppWrap({children}) {"
|
||||||
"return ("
|
"const [addEvents, connectErrors] = useContext(EventLoopContext);"
|
||||||
+ ("<StrictMode>" if react_strict_mode else "")
|
"return (" + ("<StrictMode>" if react_strict_mode else "") + "<ErrorBoundary"
|
||||||
+ "<RadixThemesColorModeProvider>"
|
) in lines
|
||||||
|
assert (
|
||||||
|
"<RadixThemesColorModeProvider>"
|
||||||
"<RadixThemesTheme accentColor={\"plum\"} css={{...theme.styles.global[':root'], ...theme.styles.global.body}}>"
|
"<RadixThemesTheme accentColor={\"plum\"} css={{...theme.styles.global[':root'], ...theme.styles.global.body}}>"
|
||||||
"<Fragment>"
|
"<Fragment>"
|
||||||
"{children}"
|
"{children}"
|
||||||
"</Fragment>"
|
"</Fragment>"
|
||||||
"</RadixThemesTheme>"
|
"</RadixThemesTheme>"
|
||||||
"</RadixThemesColorModeProvider>"
|
"</RadixThemesColorModeProvider>"
|
||||||
+ ("</StrictMode>" if react_strict_mode else "")
|
"</ErrorBoundary>" + ("</StrictMode>" if react_strict_mode else "") + ")"
|
||||||
+ ")"
|
|
||||||
"}"
|
"}"
|
||||||
) in "".join(app_js_lines)
|
) in lines
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
@ -1362,9 +1364,8 @@ def test_app_wrap_priority(
|
|||||||
app_js_lines = [
|
app_js_lines = [
|
||||||
line.strip() for line in app_js_contents.splitlines() if line.strip()
|
line.strip() for line in app_js_contents.splitlines() if line.strip()
|
||||||
]
|
]
|
||||||
|
lines = "".join(app_js_lines)
|
||||||
assert (
|
assert (
|
||||||
"function AppWrap({children}) {"
|
|
||||||
"return (" + ("<StrictMode>" if react_strict_mode else "") + "<RadixThemesBox>"
|
|
||||||
'<RadixThemesText as={"p"}>'
|
'<RadixThemesText as={"p"}>'
|
||||||
"<RadixThemesColorModeProvider>"
|
"<RadixThemesColorModeProvider>"
|
||||||
"<Fragment2>"
|
"<Fragment2>"
|
||||||
@ -1374,9 +1375,15 @@ def test_app_wrap_priority(
|
|||||||
"</Fragment2>"
|
"</Fragment2>"
|
||||||
"</RadixThemesColorModeProvider>"
|
"</RadixThemesColorModeProvider>"
|
||||||
"</RadixThemesText>"
|
"</RadixThemesText>"
|
||||||
"</RadixThemesBox>" + ("</StrictMode>" if react_strict_mode else "") + ")"
|
"</ErrorBoundary>"
|
||||||
"}"
|
"</RadixThemesBox>" + ("</StrictMode>" if react_strict_mode else "")
|
||||||
) in "".join(app_js_lines)
|
) in lines
|
||||||
|
assert (
|
||||||
|
"function AppWrap({children}) {"
|
||||||
|
"const [addEvents, connectErrors] = useContext(EventLoopContext);"
|
||||||
|
"return (" + ("<StrictMode>" if react_strict_mode else "") + "<RadixThemesBox>"
|
||||||
|
"<ErrorBoundary"
|
||||||
|
) in lines
|
||||||
|
|
||||||
|
|
||||||
def test_app_state_determination():
|
def test_app_state_determination():
|
||||||
|
Loading…
Reference in New Issue
Block a user