code: def test_grva008_shapes_not_lost(dash_dcc):
      # See issue #879 and pr #905
      app = Dash(__name__)
  
      fig = {"data": [], "layout": {"dragmode": "drawrect"}}
      graph = dcc.Graph(
          id="graph", figure=fig, style={"height": "400px"}
      )
  
      app.layout = html.Div(
          [
              graph,
              html.Br(),
              html.Button(id="button", children="Clone figure"),
              html.Div(id="output", children=""),
          ]
      )
  
      app.clientside_callback(
          """
          function clone_figure(_, figure) {
              const new_figure = {...figure};
              const shapes = new_figure.layout.shapes || [];
              return [new_figure, shapes.length];
          }
          """,
          Output("graph", "figure"),
          Output("output", "children"),
          Input("button", "n_clicks"),
          State("graph", "figure"),
      )
  
      dash_dcc.start_server(app)
      button = dash_dcc.wait_for_element("#button")
      dash_dcc.wait_for_text_to_equal("#output", "0")
  
      # Draw a shape
      dash_dcc.click_and_hold_at_coord_fractions("#graph", 0.25, 0.25)
      dash_dcc.move_to_coord_fractions("#graph", 0.35, 0.75)
      dash_dcc.release()
  
      # Click to trigger an update of the output, the shape should survive
      dash_dcc.wait_for_text_to_equal("#output", "0")
      button.click()
      dash_dcc.wait_for_text_to_equal("#output", "1")
  
      # Draw another shape
      dash_dcc.click_and_hold_at_coord_fractions("#graph", 0.75, 0.25)
      dash_dcc.move_to_coord_fractions("#graph", 0.85, 0.75)
      dash_dcc.release()
  
      # Click to trigger an update of the output, the shape should survive
      dash_dcc.wait_for_text_to_equal("#output", "1")
      button.click()
      dash_dcc.wait_for_text_to_equal("#output", "2")
  
      assert dash_dcc.get_logs() == []
  
imports: import pytest
  import time
  import json
  import werkzeug
  from selenium.webdriver import ActionChains
  from dash import Dash, Input, Output, State, dcc, html
  from dash.exceptions import PreventUpdate
  from dash.testing.wait import until
  from selenium.webdriver.common.by import By
  from selenium.webdriver.support.ui import WebDriverWait
  from selenium.webdriver.support import expected_conditions
label_desc: Use image node_id 10 for calling a global function with example usage: test_grva008_shapes_not_lost(dash_dcc) without return types