code: def test_plots_diff(dvc, mocker, plots_data):
      cli_args = parse_args(
          [
              "plots",
              "diff",
              "--out",
              "result.extension",
              "-t",
              "template",
              "--targets",
              "datafile",
              "--show-vega",
              "-x",
              "x_field",
              "-y",
              "y_field",
              "--title",
              "my_title",
              "--x-label",
              "x_title",
              "--y-label",
              "y_title",
              "--experiment",
              "HEAD",
              "tag1",
              "tag2",
          ]
      )
      assert cli_args.func == CmdPlotsDiff
  
      cmd = cli_args.func(cli_args)
      m = mocker.patch(
          "dvc.repo.plots.diff.diff", return_value=plots_data
      )
      render_mock = mocker.patch(
          "dvc_render.render_html", return_value="html_path"
      )
  
      assert cmd.run() == 0
  
      m.assert_called_once_with(
          cmd.repo,
          targets=["datafile"],
          revs=["HEAD", "tag1", "tag2"],
          props={
              "template": "template",
              "x": "x_field",
              "y": "y_field",
              "title": "my_title",
              "x_label": "x_title",
              "y_label": "y_title",
          },
          experiment=True,
      )
      render_mock.assert_not_called()
  
imports: import json
  import os
  import posixpath
  from pathlib import Path
  import pytest
  from funcy import set_in
  from dvc.cli import parse_args
  from dvc.commands.plots import CmdPlotsDiff, CmdPlotsShow, CmdPlotsTemplates
  from dvc.render.match import RendererWithErrors
  from dvc.utils.serialize import YAMLFileCorruptedError
label_desc: Use image node_id 2 for calling a global function with example usage: test_plots_diff(dvc, mocker, plots_data) without return types