Commit graph

18 commits

Author SHA1 Message Date
Evan Morikawa
d1c587a01c fix(spec): add support for async specs and disable misbehaving ones
More spec fixes

replace process.nextTick with setTimeout(fn, 0) for specs

Also added an unspy in the afterEach

Temporarily disable specs

fix(spec): start fixing specs

Summary:
This is the WIP fix to our spec runner.

Several tests have been completely commented out that will require
substantially more work to fix. These have been added to our sprint
backlog.

Other tests have been fixed to update to new APIs or to deal with genuine
bugs that were introduced without our knowing!

The most common non-trivial change relates to observing the `NylasAPI` and
`NylasAPIRequest`. We used to observe the arguments to `makeRequest`.
Unfortunately `NylasAPIRequest.run` is argumentless. Instead you can do:
`NylasAPIRequest.prototype.run.mostRecentCall.object.options` to get the
`options` passed into the object. the `.object` property grabs the context
of the spy when it was last called.

Fixing these tests uncovered several concerning issues with our test
runner. I spent a while tracking down why our participant-text-field-spec
was failling every so often. I chose that spec because it was the first
spec to likely fail, thereby requiring looking at the least number of
preceding files. I tried binary searching, turning on and off, several
files beforehand only to realize that the failure rate was not determined
by a particular preceding test, but rather the existing and quantity of
preceding tests, AND the number of console.log statements I had. There is
some processor-dependent race condition going on that needs further
investigation.

I also discovered an issue with the file-download-spec. We were getting
errors about it accessing a file, which was very suspicious given the code
stubs out all fs access. This was caused due to a spec that called an
async function outside ot a `waitsForPromise` block or a `waitsFor` block.
The test completed, the spies were cleaned up, but the downstream async
chain was still running. By the time the async chain finished the runner
was already working on the next spec and the spies had been restored
(causing the real fs access to run).

Juan had an idea to kill the specs once one fails to prevent cascading
failures. I'll implement this in the next diff update

Test Plan: npm test

Reviewers: juan, halla, jackie

Differential Revision: https://phab.nylas.com/D3501

Disable other specs

Disable more broken specs

All specs turned off till passing state

Use async-safe versions of spec functions

Add async test spec

Remove unused package code

Remove canary spec
2016-12-15 13:02:00 -05:00
Juan Tejada
2f116b8181 fix(specs) Fix remaining tests 2016-11-17 15:37:44 -08:00
Ben Gotow
8e533a3854 es6(*): Actions, ConfigSchema => ES2016 2016-10-27 18:48:33 -07:00
Ben Gotow
642977126f es6(models): Remaining models => ES2016
# Conflicts:
#	src/flux/models/contact.coffee
2016-10-27 12:08:59 -07:00
Juan Tejada
3d69ebbabb fix+🎨(notifs): Cleanup, handle nonexistent thread when opening notification
Notifications now check to see the thread they are supposed to open
exists.

Also, clean up FocusedContentStore._onFocus so that it doesn't have the side
effect of dispatching another action and messay logic.
Instead, added Actions.ensureCategoryFocused, to focus any category, and which
should be used separately from focusing content (notifications now use
this action for "opening" the thread)
Also, convert FocusedPerspectiveStore to ES6
2016-10-01 00:08:19 -07:00
Juan Tejada
2b34d2137a fix(lint): Fix coffeelint errors 2016-09-28 15:58:16 -07:00
Ben Gotow
381019552f fix(perspectives): More robust validation of saved perspectives, never open to blank screen 2016-09-28 14:46:08 -07:00
Ben Gotow
ec5092c2f5 fix(specs): attribute conversion fixed bugs, broke specs 2016-09-21 11:56:54 -07:00
Ben Gotow
c6d8bde6fd fix(accounts): Restore account re-ordering 2016-09-21 11:23:38 -07:00
Ben Gotow
54427ccb9d fix(specs) 2016-05-04 11:50:54 -07:00
Juan Tejada
7fd18f23c2 fix(perspective): Fix specs for FocusedPerspectiveStore 2016-04-11 07:59:40 -07:00
Ben Gotow
394d85cecf fix(drafts): Use the appropriate account and alias 2016-03-24 19:35:24 -07:00
Juan Tejada
68b6d7df60 fix(focused-persepective): Init saved perspective correctly
- When accounts changed and the saved perspective could reference
  accounts that no longer exist and cause all sorts of errors. This is
  fixed.
- Add specs
- Fixes some sentry errors
2016-02-09 20:10:33 -08:00
Ben Gotow
22121f9f18 Fix drafts 2016-01-25 16:37:34 -08:00
Ben Gotow
9fc11512ad CategoryPicker / PerspectiveStore spec fixes 2016-01-25 11:07:40 -08:00
Ben Gotow
96f429ff39 Unified inbox mailbox perspectives working (sidebar disabled atm) 2016-01-18 00:47:04 -08:00
Ben Gotow
212adcdf84 Search bar fixes 2016-01-11 15:58:10 -08:00
Ben Gotow
14d6cec669 Rename MailViewFilter => MailboxPerspective 2016-01-08 14:58:31 -08:00