code: def test_loca003_location_callback(dash_dcc):
      app = Dash(__name__)
      app.layout = html.Div(
          [
              dcc.Location(id="url", refresh=False),
              dcc.Location(id="callback-url", refresh="callback-nav"),
              html.Button(id="callback-btn", n_clicks=0),
              html.Div(id="content"),
          ]
      )
  
      @app.callback(
          Output("content", "children"), [Input("url", "pathname")]
      )
      def display_page(pathname):
          if pathname is None or pathname == "/page-1":
              return html.Div("1", id="div1")
          elif pathname == "/":
              return html.Div("base", id="div0")
          else:
              return "404"
  
      @app.callback(
          Output("callback-url", "pathname"),
          Input("callback-btn", "n_clicks"),
      )
      def update_location(n):
          if n > 0:
              return "/page-1"
  
      dash_dcc.start_server(app)
      dash_dcc.driver.execute_script(
          """
          window.addEventListener('_dashprivate_pushstate', function() {
              window._test_link_event_counter = (window._test_link_event_counter || 0) + 1;
          });
  
          window.addEventListener('_dashprivate_historychange', function() {
              window._test_history_event_counter = (window._test_history_event_counter || 0) + 1;
          });
      """
      )
  
      dash_dcc.wait_for_element_by_id("div0")
  
      dash_dcc.find_element("#callback-btn").click()
  
      dash_dcc.wait_for_element_by_id("div1")
  
      assert dash_dcc.get_logs() == []
  
imports: import pytest
  from dash import Dash, Input, Output, State, dcc, html
  from dash.testing.wait import until
label_desc: Use image node_id 3 for calling a global function with example usage: test_loca003_location_callback(dash_dcc) and returns: html, str, html, str