code: def test_toggle_modal():
      with app.test_client() as c:
          fig_data_outputs = "drilldown-modal-1.is_open"
          inputs = {
              "id": "input-data",
              "property": "data",
              "value": {
                  "chart_type": "scatter3d",
                  "x": "a",
                  "y": ["b"],
                  "z": "c",
                  "group": None,
                  "agg": None,
                  "window": None,
                  "rolling_comp": None,
                  "animate_by": "date",
              },
          }
          params = build_dash_request(
              fig_data_outputs,
              "chart-1.clickData",
              [
                  {
                      "id": "close-drilldown-modal-1",
                      "property": "n_clicks",
                      "value": None,
                  },
                  {
                      "id": "close-drilldown-modal-header-1",
                      "property": "n_clicks",
                      "value": None,
                  },
                  {
                      "id": "chart-1",
                      "property": "clickData",
                      "value": None,
                  },
              ],
              [
                  {
                      "id": "drilldown-modal-1",
                      "property": "is_open",
                      "value": False,
                  },
                  inputs,
                  {
                      "id": "drilldown-toggle",
                      "property": "on",
                      "value": False,
                  },
              ],
          )
          response = c.post(
              "/dtale/charts/_dash-update-component", json=params
          )
          assert response.get_json() is None
          assert response.status_code == 204
          params["state"][-1]["value"] = True
          response = c.post(
              "/dtale/charts/_dash-update-component", json=params
          )
          assert response.get_json() is None
          assert response.status_code == 204
          params["state"][1]["value"]["agg"] = "mean"
          response = c.post(
              "/dtale/charts/_dash-update-component", json=params
          )
          assert not response.get_json()["response"][
              "drilldown-modal-1"
          ]["is_open"]
          params["inputs"][-1]["value"] = {"points": []}
          response = c.post(
              "/dtale/charts/_dash-update-component", json=params
          )
          assert response.get_json()["response"]["drilldown-modal-1"][
              "is_open"
          ]
  
file_path: dtale/tests/dtale/dash/test_drilldown.py
imports: import pandas
  import pytest
  from tests.dtale import build_data_inst
  from tests.dtale.dash.test_dash import build_dash_request, print_traceback, ts_builder
  from tests.dtale.test_views import app
label_desc: Use image node_id 1 for calling a global function with example usage: test_toggle_modal() without return types