diff --git a/src/__mocks__/categories.js b/src/__mocks__/categories.js new file mode 100644 index 00000000..ddd0645e --- /dev/null +++ b/src/__mocks__/categories.js @@ -0,0 +1,12 @@ +export default [ + { + id: 1, + name: "Commands", + command() {} + }, + { + id: 2, + name: "Files", + command() {} + }, +]; diff --git a/src/__mocks__/files.js b/src/__mocks__/files.js new file mode 100644 index 00000000..d6755248 --- /dev/null +++ b/src/__mocks__/files.js @@ -0,0 +1,254 @@ +export default [ + { + id: 0, + name: "global_commands.js", + filePath: "src/__mocks__", + fileType: "javascript", + command() {} + }, + { + id: 1, + name: "files.js", + filePath: "src/__mocks__", + fileType: "javascript", + command() {} + }, + { + id: 2, + name: "README.md", + filePath: "", + fileType: "markdown", + command() {} + }, + { + id: 3, + name: "sampleSublimeCommand.css", + filePath: "examples", + fileType: "css", + command() {} + }, + { + id: 4, + name: "sampleChromeCommand.css", + filePath: "examples", + fileType: "css", + command() {} + }, + { + id: 5, + name: "render-command.js", + filePath: "src", + fileType: "javascript", + command() {} + }, + { + id: 6, + name: "lots_of_commands.js", + filePath: "src/__mocks__", + fileType: "javascript", + command() {} + }, + { + id: 7, + name: "sampleChromeCommand.js", + filePath: "examples", + fileType: "css", + command() {} + }, + { + id: 8, + name: "styleMock.js", + filePath: "src/__mocks__", + fileType: "javascript", + command() {} + }, + { + id: 9, + name: "sampleHeader.js", + filePath: "examples", + fileType: "css", + command() {} + }, + { + id: 110, + name: "palette-trigger.js", + filePath: "src", + fileType: "javascript", + command() {} + }, + { + id: 111, + name: "default-command.js", + filePath: "src", + fileType: "javascript", + command() {} + }, + { + id: 112, + name: "command-palette.js", + filePath: "src", + fileType: "javascript", + command() {} + }, + { + id: 113, + name: "sampleSublimeTheme.md", + filePath: "examples", + fileType: "css", + command() {} + }, + { + id: 114, + name: "render-command.test.js", + filePath: "src", + fileType: "javascript", + command() {} + }, + { + id: 115, + name: "sampleVSCodeCommandPalette.js", + filePath: "examples", + fileType: "css", + command() {} + }, + { + id: 116, + name: "default-command.test.js", + filePath: "src", + fileType: "javascript", + command() {} + }, + { + id: 117, + name: "sampleVSCodeCommand.css", + filePath: "examples", + fileType: "css", + command() {} + }, + { + id: 118, + name: "palette-spinner.test.js", + filePath: "src", + fileType: "javascript", + command() {} + }, + { + id: 119, + name: "categories.js", + filePath: "src/__mocks__", + fileType: "javascript", + command() {} + }, + { + id: 220, + name: "sampleChromeTheme.md", + filePath: "examples", + fileType: "css", + command() {} + }, + { + id: 221, + name: "sampleAtomCommand.js", + filePath: "examples", + fileType: "css", + command() {} + }, + { + id: 222, + name: "sampleAtomCommand.css", + filePath: "examples", + fileType: "css", + command() {} + }, + { + id: 223, + name: "fuzzysort-options.js", + filePath: "src", + fileType: "javascript", + command() {} + }, + { + id: 224, + name: "commands.js", + filePath: "src/__mocks__", + fileType: "javascript", + command() {} + }, + { + id: 225, + name: "sampleVSCodeCommand.js", + filePath: "examples", + fileType: "css", + command() {} + }, + { + id: 226, + name: "fileMock.js", + filePath: "src/__mocks__", + fileType: "javascript", + command() {} + }, + { + id: 227, + name: "palette-spinner.css", + filePath: "src", + fileType: "javascript", + command() {} + }, + { + id: 228, + name: "command-palette.test.js", + filePath: "src", + fileType: "javascript", + command() {} + }, + { + id: 229, + name: "sampleAtomTheme.md", + filePath: "examples", + fileType: "css", + command() {} + }, + { + id: 330, + name: "suggestions.js", + filePath: "src", + fileType: "javascript", + command() {} + }, + { + id: 331, + name: "suggestions.test.js", + filePath: "src", + fileType: "javascript", + command() {} + }, + { + id: 332, + name: "palette-spinner.js", + filePath: "src", + fileType: "javascript", + command() {} + }, + { + id: 333, + name: "sampleSublimeCommand.js", + filePath: "examples", + fileType: "css", + command() {} + }, + { + id: 334, + name: "palette-trigger.test.js", + filePath: "src", + fileType: "javascript", + command() {} + }, + { + id: 335, + name: "test-helpers.js", + filePath: "src", + fileType: "javascript", + command() {} + } +]; diff --git a/src/__mocks__/global_commands.js b/src/__mocks__/global_commands.js new file mode 100644 index 00000000..f1f15ccb --- /dev/null +++ b/src/__mocks__/global_commands.js @@ -0,0 +1,86 @@ +export default [ + { + id: 1, + name: "Go to File", + category: "…", + command() {} + }, + { + id: 2, + name: "Go to Symbol in Workspace", + category: "#", + command() {} + }, + { + id: 3, + name: "Show and Run Commands", + category: ">", + command() {} + }, + { + id: 4, + name: "Debug Configuration", + category: "debug", + command() {} + }, + { + id: 5, + name: "Show All Opened Editors", + category: "edit", + command() {} + }, + { + id: 6, + name: "Show Editors in Active Group", + category: "edit active", + command() {} + }, + { + id: 7, + name: "Manage Extensions", + category: "ext", + command() {} + }, + { + id: 8, + name: "Install Gallery Extensions", + category: "ext install", + command() {} + }, + { + id: 9, + name: "Run Task", + category: "task", + command() {} + }, + { + id: 10, + name: "Show All Opened Terminals", + category: "term", + command() {} + }, + { + id: 11, + name: "Open View", + category: "view", + command() {} + }, + { + id: 12, + name: "Go to Line", + category: ":", + command() {} + }, + { + id: 13, + name: "Go to Symbol in File", + category: "@", + command() {} + }, + { + id: 14, + name: "Go to Symbol in File by Category", + category: "@:", + command() {} + } +]; diff --git a/src/__snapshots__/command-palette.test.js.snap b/src/__snapshots__/command-palette.test.js.snap index 74228fc8..0c5131dd 100644 --- a/src/__snapshots__/command-palette.test.js.snap +++ b/src/__snapshots__/command-palette.test.js.snap @@ -295,7 +295,7 @@ exports[`Command List renders a command 1`] = ` class="atom-input atom-inputOpen" placeholder="Type a command" type="text" - value="Start All Data Imports" + value="" />
  • -
    -
    -
    + - -
    -
      -
    • -
      - - Start All Data Imports - -
      -
    • -
    • -
      - - Stop All Data Imports - -
      -
    • -
    • -
      - - Delete All Tenant - -
      -
    • -
    • -
      - - Go offline - -
      -
    • -
    • -
      - - Go online - -
      -
    • -
    • -
      - - Jump to Tenant - -
      -
    • -
    • -
      - - View Logs - -
      -
    • -
    -
    -
    + Loading... + +
    +
    +
  • + +
    +
    + +
    +
    +
    +
    +
    @@ -1622,11 +1552,12 @@ exports[`Command List renders a command 1`] = ` role="combobox" > @@ -1640,8 +1571,8 @@ exports[`Command List renders a command 1`] = ` role="listbox" >
  • -
    -
    @@ -1782,11 +1707,12 @@ exports[`Command List renders a command 1`] = ` role="combobox" > @@ -1800,8 +1726,8 @@ exports[`Command List renders a command 1`] = ` role="listbox" >
  • +
    +
    @@ -1936,6 +1868,7 @@ exports[`Command List renders a command 1`] = ` role="combobox" >
  • -
    @@ -2376,6 +2306,164 @@ exports[`Command List renders a command 1`] = `
    +
    +
    +
    + +
    @@ -2447,6 +2535,7 @@ exports[`Command List renders a command 1`] = ` role="combobox" >
  • -
    -
    -
    + - -
    -
      -
    • -
      - - Start All Data Imports - -
      -
    • -
    • -
      - - Stop All Data Imports - -
      -
    • -
    • -
      - - Delete All Tenant - -
      -
    • -
    • -
      - - Go offline - -
      -
    • -
    • -
      - - Go online - -
      -
    • -
    • -
      - - Jump to Tenant - -
      -
    • -
    • -
      - - View Logs - -
      -
    • -
    -
    -
    + Loading... + +
    +
    +
  • +
    +
    +
    + +
    +
    +
    +
    +
    @@ -7109,11 +7146,12 @@ exports[`Command List renders a command 1`] = ` role="combobox" > @@ -7127,8 +7165,8 @@ exports[`Command List renders a command 1`] = ` role="listbox" >
  • -
    -
    @@ -7269,11 +7301,12 @@ exports[`Command List renders a command 1`] = ` role="combobox" > @@ -7287,8 +7320,8 @@ exports[`Command List renders a command 1`] = ` role="listbox" >
  • +
    +
    @@ -7423,6 +7462,7 @@ exports[`Command List renders a command 1`] = ` role="combobox" >
  • +
    +
      +
    • +
      + + Start All Data Imports + +
      +
    • +
    • +
      + + Stop All Data Imports + +
      +
    • +
    • +
      + + Delete All Tenant + +
      +
    • +
    • +
      + + Go offline + +
      +
    • +
    • +
      + + Go online + +
      +
    • +
    • +
      + + Jump to Tenant + +
      +
    • +
    • +
      + + View Logs + +
      +
    • +
    +
    +
  • +
    +
    +
    +
    +
    +
    +