code: def test_to_json(fig1):
      assert pio.to_json(fig1, remove_uids=False) == json.dumps(
          fig1, **opts
      )
  
imports: import plotly.graph_objs
  import plotly.io
  import pytest
  import plotly
  import json
  import os
  import tempfile
  from unittest.mock import MagicMock
  from pathlib import Path
label_desc: Use image node_id 2 for calling a global function with example usage: test_to_json(fig1) without return types