code: def test_ldcp004_nested_loading_components(dash_dcc):
      lock = Lock()
  
      app = Dash(__name__)
  
      app.layout = html.Div(
          [
              dcc.Loading(
                  [
                      html.Button(id="btn-1"),
                      dcc.Loading(
                          [html.Button(id="btn-2")],
                          className="loading-2",
                      ),
                  ],
                  className="loading-1",
              )
          ],
          id="root",
      )
  
      @app.callback(
          Output("btn-1", "children"), [Input("btn-2", "n_clicks")]
      )
      def updateDiv1(n_clicks):
          if n_clicks is not None:
              with lock:
                  return "changed 1"
  
          return "content 1"
  
      @app.callback(
          Output("btn-2", "children"), [Input("btn-1", "n_clicks")]
      )
      def updateDiv2(n_clicks):
          if n_clicks is not None:
              with lock:
                  return "changed 2"
  
          return "content 2"
  
      dash_dcc.start_server(app)
  
      dash_dcc.wait_for_text_to_equal("#btn-1", "content 1")
      dash_dcc.wait_for_text_to_equal("#btn-2", "content 2")
  
      with lock:
          dash_dcc.find_element("#btn-1").click()
  
          dash_dcc.find_element(".loading-2 .dash-spinner")
          dash_dcc.wait_for_text_to_equal("#btn-2", "")
  
      dash_dcc.wait_for_text_to_equal("#btn-2", "changed 2")
  
      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-1", "")
  
      dash_dcc.wait_for_text_to_equal("#btn-1", "changed 1")
  
      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 4 for calling a global function with example usage: test_ldcp004_nested_loading_components(dash_dcc) and returns: str, str, str, str