code: def test_toggle_modal():
      with app.test_client() as c:
          params = {
              "output": "geojson-modal.is_open",
              "changedPropIds": ["geojson-dropdown.value"],
              "inputs": [
                  {
                      "id": "open-geojson-modal",
                      "property": "n_clicks",
                      "value": 0,
                  },
                  {
                      "id": "close-geojson-modal",
                      "property": "n_clicks",
                      "value": 0,
                  },
              ],
              "state": [
                  {
                      "id": "geojson-modal",
                      "property": "is_open",
                      "value": True,
                  }
              ],
          }
          response = c.post(
              "/dtale/charts/_dash-update-component", json=params
          )
          resp_data = response.get_json()["response"]
          assert resp_data["geojson-modal"]["is_open"]
  
          params["inputs"][0]["value"] = 1
          response = c.post(
              "/dtale/charts/_dash-update-component", json=params
          )
          resp_data = response.get_json()["response"]
          assert not resp_data["geojson-modal"]["is_open"]
  
          params["state"][0]["value"] = False
          response = c.post(
              "/dtale/charts/_dash-update-component", json=params
          )
          resp_data = response.get_json()["response"]
          assert resp_data["geojson-modal"]["is_open"]
  
file_path: dtale/tests/dtale/dash/test_custom_geojson.py
imports: import base64
  import json
  import mock
  import os
  import pandas
  import pytest
  from tests import ExitStack
  from tests.dtale import build_data_inst
  from tests.dtale.dash.test_dash import build_chart_params
  from tests.dtale.test_views import app
label_desc: Use image node_id 4 for calling a global function with example usage: test_toggle_modal() without return types