summaryrefslogtreecommitdiffstats
path: root/devtools/client/debugger/src/utils/editor/tests/create-editor.spec.js
blob: fe7cd5dcc61c3961fbef513dd4f750ef076b0c23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */

import { createEditor } from "../create-editor";

import { features } from "../../prefs";

describe("createEditor", () => {
  test("SourceEditor default config", () => {
    const editor = createEditor();
    expect(editor.config).toMatchSnapshot();
    expect(editor.config.gutters).not.toContain("CodeMirror-foldgutter");
  });

  test("Adds codeFolding", () => {
    features.codeFolding = true;
    const editor = createEditor();
    expect(editor.config).toMatchSnapshot();
    expect(editor.config.gutters).toContain("CodeMirror-foldgutter");
  });
});