code: def test_show_mermaid_markdown(repo, dvc, capsys, mocker):
      mocker.patch(
          "dvc.commands.dag._build", return_value=dvc.index.graph
      )
  
      capsys.readouterr()
      assert main(["dag", "--md"]) == 0
      assert [
          line.rstrip() for line in capsys.readouterr().out.splitlines()
      ] == [
          "```mermaid",
          "flowchart TD",
          "\tnode1[\"stage: '1'\"]",
          "\tnode2[\"stage: '2'\"]",
          "\tnode3[\"stage: '3'\"]",
          "\tnode4[\"stage: '4'\"]",
          "\tnode5[\"stage: 'a.dvc'\"]",
          "\tnode6[\"stage: 'b.dvc'\"]",
          "\tnode3-->node4",
          "\tnode5-->node1",
          "\tnode5-->node3",
          "\tnode5-->node4",
          "\tnode6-->node2",
          "\tnode6-->node3",
          "```",
      ]
  
file_path: dvc/tests/unit/command/test_dag.py
imports: import networkx
  import pytest
  from dvc.cli import main, parse_args
  from dvc.commands.dag import CmdDAG, _build, _show_ascii, _show_dot, _show_mermaid
label_desc: Use image node_id 13 for calling a global function with example usage: test_show_mermaid_markdown(repo, dvc, capsys, mocker) without return types