Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test document is not retrievable from within tests #214

Open
WCByrne opened this issue Mar 14, 2019 · 1 comment
Open

Test document is not retrievable from within tests #214

WCByrne opened this issue Mar 14, 2019 · 1 comment
Labels

Comments

@WCByrne
Copy link

WCByrne commented Mar 14, 2019

Each test case is provided a document. The functions for fetching documents in the API don't seem to include those test documents making it a little hard to test.

For example:

test("should get document", (context, doc) => {
  const selected = sketch.getSelectedDocument();
  const found = sketch.Document.getDocuments().find(d => doc.id === d.id);
  expect(found).toBeTruthy();
  expect(doc.id).toEqual(selected.id);
});

Would it make sense for the test runner to mock these out or at least set the test document as the selected doc before running the test case?

@mathieudutour
Copy link
Member

hum the thing is that the document provided is just an MSDocumentData, not all the APIs are available but it's a lot faster because it's in memory and no UI changes happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants