Esempio n. 1
0
export function dispatchSave(store) {
  const state = store.getState();
  const notebook = state.document.get("notebook");
  const filename = state.document.get("filename");
  if (!filename) {
    triggerSaveAs(store);
  } else {
    store.dispatch(save(filename, notebook));
  }
}
Esempio n. 2
0
  test("saves the file using the notebook in the state tree", async function() {
    const store = dummyStore();

    const responses = await saveEpic(ActionsObservable.of(save()), store)
      .pipe(toArray())
      .toPromise();

    // TODO: This should be testing that the mocks for fs were called with the
    // filename and notebook from the state tree

    expect(responses).toEqual([{ type: "DONE_SAVING" }]);
  });