"use babel";

// const { dialog } = require("electron").remote;
const { existsSync } = require("fs");
import { loadNotebook } from "../lib/import-notebook";
import { waitAsync } from "./helpers/test-utils";

describe("Import notebook", () => {
  const sampleNotebook = require.resolve("./helpers/test-notebook.ipynb");
  beforeEach(
    waitAsync(async () => {
      await atom.packages.activatePackage("language-python");
      await loadNotebook(sampleNotebook);
    })
  );

  it("Should import a notebook and convert it to a script", () => {
    const editor = atom.workspace.getActiveTextEditor();
    const code = editor.getText();
    expect(code.split("\n")).toEqual([
      "# %%",
      "import pandas as pd",
      "# %%",
      "pd.util.testing.makeDataFrame()",
      "# %%",
      ""
    ]);
  });
});

@@ -104,16 +104,17 @@
 mport %7B 
+_
 loadNote
@@ -429,16 +429,17 @@
   await 
+_
 loadNote

Fix import notebook test (#1531)