code: def test_stcp002_modified_ts(store_app, dash_dcc):
      app = Dash(__name__)
      app.layout = html.Div(
          [
              dcc.Store(id="initial-storage", storage_type="session"),
              html.Button("set-init-storage", id="set-init-storage"),
              html.Div(id="init-output"),
          ]
      )
  
      @app.callback(
          Output("initial-storage", "data"),
          [Input("set-init-storage", "n_clicks")],
      )
      def on_init(n_clicks):
          if n_clicks is None:
              raise PreventUpdate
          return "initialized"
  
      @app.callback(
          Output("init-output", "children"),
          [Input("initial-storage", "modified_timestamp")],
          [State("initial-storage", "data")],
      )
      def init_output(ts, data):
          return json.dumps({"data": data, "ts": ts})
  
      dash_dcc.start_server(app)
  
      dash_dcc.find_element("#set-init-storage").click()
      # the python ts ends at seconds while javascript one ends at ms
      ts = float(time.time() * 1000)
  
      wait.until(
          lambda: "initialized"
          in dash_dcc.find_element("#init-output").text,
          timeout=3,
      )
  
      output_data = json.loads(
          dash_dcc.find_element("#init-output").text
      )
  
      assert (
          output_data.get("data") == "initialized"
      ), "the data should be the text set in on_init"
      assert ts == approx(
          output_data.get("ts"), abs=40
      ), "the modified_timestamp should be updated right after the click action"
  
      assert dash_dcc.get_logs() == []
  
file_path: dash/components/dash-core-components/tests/integration/store/test_component_props.py
imports: import json
  import time
  from pytest import approx
  from dash import Dash, Input, State, Output, dcc, html
  from dash.exceptions import PreventUpdate
  import dash.testing.wait
label_desc: Use image node_id 2 for calling a global function with example usage: test_stcp002_modified_ts(store_app, dash_dcc) and returns: str, json