def METHOD_NAME(fig1, fig_type_spec, fig_type):
    # Configure file-like mock
    filemock = MagicMock()
    del filemock.read_text
    filemock.read.return_value = pio.to_json(fig1)
    # read_json on mock file
    fig1_loaded = pio.read_json(filemock, output_type=fig_type_spec)
    # Check return type
    assert isinstance(fig1_loaded, fig_type)
    # Check loaded figure
    assert pio.to_json(fig1_loaded) == pio.to_json(fig1.to_dict())