code: def test_ldcp005_dynamic_loading_component(dash_dcc):
      lock = Lock()
  
      app = Dash(__name__, suppress_callback_exceptions=True)
  
      app.layout = html.Div(
          [html.Button(id="btn-1"), html.Div(id="div-1")]
      )
  
      @app.callback(
          Output("div-1", "children"), [Input("btn-1", "n_clicks")]
      )
      def updateDiv(n_clicks):
          if n_clicks is None:
              return
  
          with lock:
              return html.Div(
                  [
                      html.Button(id="btn-2"),
                      dcc.Loading(
                          [html.Button(id="btn-3")],
                          className="loading-1",
                      ),
                  ]
              )
  
      @app.callback(
          Output("btn-3", "children"), [Input("btn-2", "n_clicks")]
      )
      def updateDynamic(n_clicks):
          if n_clicks is None:
              return "content"
  
          with lock:
              return "changed"
  
      dash_dcc.start_server(app)
  
      dash_dcc.find_element("#btn-1")
      dash_dcc.wait_for_text_to_equal("#div-1", "")
  
      dash_dcc.find_element("#btn-1").click()
  
      dash_dcc.find_element("#div-1 #btn-2")
      dash_dcc.wait_for_text_to_equal("#btn-3", "content")
  
      with lock:
          dash_dcc.find_element("#btn-2").click()
  
          dash_dcc.find_element(".loading-1 .dash-spinner")
          dash_dcc.wait_for_text_to_equal("#btn-3", "")
  
      dash_dcc.wait_for_text_to_equal("#btn-3", "changed")
  
      assert dash_dcc.get_logs() == []
  
file_path: dash/components/dash-core-components/tests/integration/loading/test_loading_component.py
imports: from multiprocessing import Lock
  from dash import Dash, Input, Output, dcc, html
  from dash.testing import wait
label_desc: Use image node_id 5 for calling a global function with example usage: test_ldcp005_dynamic_loading_component(dash_dcc) and returns: html, str, str