def test_app_wrap_compile_theme(
    react_strict_mode: bool, compilable_app: tuple[App, Path], mocker
):
    """Test that the radix theme component wraps the app.

    Args:
        react_strict_mode: Whether to use React Strict Mode.
        compilable_app: compilable_app fixture.
        mocker: pytest mocker object.
    """
    conf = rx.Config(app_name="testing", react_strict_mode=react_strict_mode)
    mocker.patch("reflex.config._get_config", return_value=conf)
    app, web_dir = compilable_app
    mocker.patch("reflex.utils.prerequisites.get_web_dir", return_value=web_dir)
    app.theme = rx.theme(accent_color="plum")
    app._compile()
    app_js_contents = (web_dir / "pages" / "_app.js").read_text()
    app_js_lines = [
        line.strip() for line in app_js_contents.splitlines() if line.strip()
    ]
    lines = "".join(app_js_lines)
    expected = (
        "function AppWrap({children}) {"
        "return ("
        + ("jsx(StrictMode,{}," if react_strict_mode else "")
        + "jsx(RadixThemesColorModeProvider,{},"
        "jsx(RadixThemesTheme,{accentColor:\"plum\",css:{...theme.styles.global[':root'], ...theme.styles.global.body}},"
        "jsx(Fragment,{},"
        "jsx(MemoizedToastProvider,{},),"
        "jsx(Fragment,{},"
        "children,"
        "),"
        "),"
        "),"
        ")" + (",)" if react_strict_mode else "") + ")"
        "}"
    )
    assert expected in lines
Test that the radix theme component wraps the app.

    Args:
        react_strict_mode: Whether to use React Strict Mode.
        compilable_app: compilable_app fixture.
        mocker: pytest mocker object.
    
tests/units/test_app.py