code: def test_mkdw007_load_mathjax(dash_dcc, is_eager):
      app = Dash(__name__, eager_loading=is_eager)
  
      gravity = "$F=\\frac{Gm_1m_2}{r^2}$"
  
      app.layout = html.Div(
          [
              html.Button("Add Second MathJax", id="btn"),
              dcc.Markdown(
                  f"""
                      # No Math Rendering Here! {gravity}
                  """,
                  id="md",
                  mathjax=False,
              ),
              html.Div("initial", id="out"),
          ]
      )
  
      @app.callback(
          Output("out", "children"),
          Input("btn", "n_clicks"),
          prevent_initial_call=True,
      )
      def add_math(n):
          return dcc.Markdown(
              f"# Math!\n{gravity}", id="md2", mathjax=True
          )
  
      dash_dcc.start_server(app)
  
      # Initial state: no MathJax loaded or rendered, unformatted text is shown
      dash_dcc.wait_for_contains_text("#md", gravity)
      dash_dcc.wait_for_no_elements("#md svg")
      assert not dash_dcc.driver.execute_script(
          "return !!window.MathJax"
      )
  
      btn = dash_dcc.find_element("#btn")
      btn.click()
  
      # One click: MathJax is loaded and rendered on the second, unformatted text is gone
  
      dash_dcc.wait_for_element("#md2 svg")
      assert gravity not in dash_dcc._get_element("#md2").text
      assert dash_dcc.driver.execute_script("return !!window.MathJax")
  
file_path: dash/components/dash-core-components/tests/integration/markdown/test_markdown.py
imports: import pytest
  from dash import Dash, dcc, html, Input, Output
  from dash.testing.wait import until
label_desc: Use image node_id 7 for calling a global function with example usage: test_mkdw007_load_mathjax(dash_dcc, is_eager) and returns: dcc