code: def test_grva009_originals_maintained_for_responsive_override(
      mutate_fig, dash_dcc
  ):
      # In #905 we made changes to prevent shapes from being lost.
      # This test makes sure that the overrides applied by the `responsive`
      # prop are "undone" when the `responsive` prop changes.
  
      app = Dash(__name__)
  
      graph = dcc.Graph(
          id="graph",
          figure={
              "data": [{"y": [1, 2]}],
              "layout": {"width": 300, "height": 250},
          },
          style={"height": "400px", "width": "500px"},
      )
      responsive_size = [500, 400]
      fixed_size = [300, 250]
  
      app.layout = html.Div(
          [
              graph,
              html.Br(),
              html.Button(id="edit_figure", children="Edit figure"),
              html.Button(
                  id="edit_responsive", children="Edit responsive"
              ),
              html.Div(id="output", children=""),
          ]
      )
  
      if mutate_fig:
          # Modify the layout in place (which still has changes made by responsive)
          change_fig = """
              figure.layout.title = {text: String(n_fig || 0)};
              const new_figure = {...figure};
          """
      else:
          # Or create a new one each time
          change_fig = """
              const new_figure = {
                  data: [{y: [1, 2]}],
                  layout: {width: 300, height: 250, title: {text: String(n_fig || 0)}}
              };
          """
  
      callback = (
          """
          function clone_figure(n_fig, n_resp, figure) {
          """
          + change_fig
          + """
              let responsive = [true, false, 'auto'][(n_resp || 0) % 3];
              return [new_figure, responsive, (n_fig || 0) + ' ' + responsive];
          }
          """
      )
  
      app.clientside_callback(
          callback,
          Output("graph", "figure"),
          Output("graph", "responsive"),
          Output("output", "children"),
          Input("edit_figure", "n_clicks"),
          Input("edit_responsive", "n_clicks"),
          State("graph", "figure"),
      )
  
      dash_dcc.start_server(app)
      edit_figure = dash_dcc.wait_for_element("#edit_figure")
      edit_responsive = dash_dcc.wait_for_element("#edit_responsive")
  
      def graph_dims():
          return dash_dcc.driver.execute_script(
              """
              const layout = document.querySelector('.js-plotly-plot')._fullLayout;
              return [layout.width, layout.height];
              """
          )
  
      dash_dcc.wait_for_text_to_equal("#output", "0 true")
      dash_dcc.wait_for_text_to_equal(".gtitle", "0")
      assert graph_dims() == responsive_size
  
      edit_figure.click()
      dash_dcc.wait_for_text_to_equal("#output", "1 true")
      dash_dcc.wait_for_text_to_equal(".gtitle", "1")
      assert graph_dims() == responsive_size
  
      edit_responsive.click()
      dash_dcc.wait_for_text_to_equal("#output", "1 false")
      dash_dcc.wait_for_text_to_equal(".gtitle", "1")
      assert graph_dims() == fixed_size
  
      edit_figure.click()
      dash_dcc.wait_for_text_to_equal("#output", "2 false")
      dash_dcc.wait_for_text_to_equal(".gtitle", "2")
      assert graph_dims() == fixed_size
  
      edit_responsive.click()
      dash_dcc.wait_for_text_to_equal("#output", "2 auto")
      dash_dcc.wait_for_text_to_equal(".gtitle", "2")
      assert graph_dims() == fixed_size
  
      edit_figure.click()
      dash_dcc.wait_for_text_to_equal("#output", "3 auto")
      dash_dcc.wait_for_text_to_equal(".gtitle", "3")
      assert graph_dims() == fixed_size
  
      edit_responsive.click()
      dash_dcc.wait_for_text_to_equal("#output", "3 true")
      dash_dcc.wait_for_text_to_equal(".gtitle", "3")
      assert graph_dims() == responsive_size
  
      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 11 for calling a global function with example usage: test_grva009_originals_maintained_for_responsive_override(mutate_fig, dash_dcc) and returns: dash_dcc