Commit graph

486 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
Halla Moore 1f36388b93 update(send): Pass in the upload data that local-sync expects
Since local-sync can access the same targetPaths as N1, there's
no need to create actual File instances anymore. Pass just the
upload data in the API request, and remove SyncbackDraftFilesTask
since it is no longer necessary.
2016-12-07 14:19:07 -08:00
Evan Morikawa f170d14b8d fix(errors): properly rethrow api error 2016-12-06 17:21:37 -08:00
Jackie Luo 0e388d5c8c rm(send-successful): Remove NotifyPluginsOfSendTask 2016-12-06 16:45:32 -08:00
Jackie Luo 8026d1e1a5 fix(spelling): Correct references 2016-12-06 16:05:05 -08:00
Evan Morikawa ace9b94053 feat(key): use unified key manager 2016-12-05 17:19:19 -08:00
Jackie Luo 871eb524ec fix(nylas-api): Correct some imports and remove tests for plugin auth 2016-12-05 11:37:27 -08:00
Jackie Luo ad5a1a6316 refactor(nylas-api): Make requests with helpers 2016-12-02 15:51:38 -08:00
Ben Gotow fb13abe8f4 fix(deltas): Process all deltas of each class in a single pass
Also changed the DeltaProcessor so it doesn’t query for models before sending out `Actions.didPassivelyReceiveCreateDeltas`, and renames it to be more clear it’s about deltas.
2016-12-02 11:41:49 -08:00
Ben Gotow 6d85a8ef81 lint(*): Fix linter errors within K2, update eslint grunt task 2016-12-01 15:38:16 -08:00
Ben Gotow ce14e3b12e fix(specs): Fix AccountStore specs 2016-12-01 13:50:31 -08:00
Jackie Luo 8818ad1957 spec(nylas-api): Update tests to use NylasAPIRequest 2016-11-29 16:32:23 -08:00
Evan Morikawa 02c3b78d94 fix(lint): fix linter import error 2016-11-18 11:13:21 -08:00
Juan Tejada 2f116b8181 fix(specs) Fix remaining tests 2016-11-17 15:37:44 -08:00
Juan Tejada 710dc1a4c4 fix(db-transaction): Make sure we mark as not bg-able query objects
When forwarding query operations to the database (e.g. find, findAll)
from the transaction,
we didn't check if those methods actually returned a ModelQuery object
(e.g. modelify returns a regular Promise), so this would break in cases
where it wasn't defined (`markNotBackgroundable` would be undefined)

This commit fixes that and fixes related specs
2016-11-17 14:03:06 -08:00
Jackie Luo e3e8c28c57 lint(eslint): Update to new rule names 2016-11-15 16:49:11 -08:00
Evan Morikawa e43de77708 fix(lint): update files to for new linter version 2016-11-15 10:20:39 -08:00
Evan Morikawa 9cde226598 refactor(registry): move all registries into src/registries 2016-11-14 14:01:00 -08:00
Evan Morikawa 5c81f083ce fix(quote): fix more cases of unwrapped signature detection 2016-11-14 11:55:37 -08:00
Evan Morikawa ecb7a0e4aa fix(quote): catch Office 365 quoted text case 2016-11-14 11:55:31 -08:00
Ben Gotow 25c32ec5d9 specs(spellcheck): Ignore on linux due to dict downloads 2016-11-09 15:58:57 -08:00
Ben Gotow 83adb8e74f fix(spellcheck): Wait longer, electron-spellchecker actually downloads dicts 2016-11-09 15:07:30 -08:00
Ben Gotow d819479613 fix(mailto): Improve handling of invalid urls 2016-11-07 14:09:47 -08:00
Juan Tejada 69161e8f04 fix(specs) Fix date-utils specs 2016-11-07 12:15:47 -08:00
Evan Morikawa dbc81a87a4 feat(quote): improved quoted text detection for trailing signatures 2016-11-04 20:45:25 -07:00
Evan Morikawa c0b28456a9 fix(quote): properly detect "wrote: " strings with trailing space 2016-11-04 18:39:37 -07:00
Evan Morikawa 4a40074cd1 convert(es6): quoted-html-transformer to es6 2016-11-04 18:28:11 -07:00
Juan Tejada 189b15e586 feat(attachments): Generate and display thumbnail previews for files (mac only)
Summary: Adds option to view preview thumbnails for attachments. This commit updates the FileDownloadStore to generate file thumbnail previews for attachments via `qlmanage` and displays them in the AttachmentItem component.

Test Plan: Manual

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D3393
2016-11-02 17:27:53 -07:00
Halla Moore 6f571a323f fix(decaffeination) Remove second arg from some slice calls
Decaffination replaces someString[index..-1] with
someString.slice(index, -1 + 1), which is bizzare. This commit changes those
instances to someString.slice(index).
2016-11-02 12:40:01 -07:00
Juan Tejada 13586d2886 fix(specs): Add regression test for list-selection 2016-11-02 11:46:28 -07:00
Juan Tejada 5fa379bccf fix(es6): Convert FileDownloadStore to JS 2016-11-01 18:12:24 -07:00
Evan Morikawa 8ab3fba7da fix(es6): fix linter and compile error in es6 conversion 2016-10-28 09:59:41 -04:00
Ben Gotow 8e533a3854 es6(*): Actions, ConfigSchema => ES2016 2016-10-27 18:48:33 -07:00
Ben Gotow a9b0472030 es6(*): Misc components, nylas-exports => ES2016 2016-10-27 18:25:30 -07:00
Ben Gotow 0a56d30a22 es6(composer): Composer extensions => ES2016 2016-10-27 17:28:36 -07:00
Ben Gotow e7c22eacbc fix(spec): Apply jasmine styles to windowed specs 2016-10-27 12:44:22 -07:00
Evan Morikawa 0adc1261f6 fix(spec): let ./N1.sh --test=window work 2016-10-27 15:24:13 -04:00
Ben Gotow 781d061ee8 es6(*): Misc src to ES2016 2016-10-27 12:08:59 -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 645a032a50 fix(specs): Fix remaining broken specs 2016-10-27 11:44:19 -07:00
Juan Tejada da48d8433e fix(specs): Fix date input specs 2016-10-27 11:35:37 -07:00
Juan Tejada f2e7ea4c4c feat(reminders): Add send reminders functionality
Summary: Add reminders plugin which lets you set reminder if you don't get a reply for a message within a specified time in the future

Test Plan: TODO

Reviewers: halla, bengotow, evan

Reviewed By: halla, bengotow, evan

Differential Revision: https://phab.nylas.com/D3356
2016-10-27 08:49:29 -07:00
Juan Tejada 5d837ffd02 feat(undo-send): Add undo send
Summary:
Add ability to undo send. We decided to make undo send completely client side for a couple of reasons. If we rely on send-later for undo-send, we would be giving /all/ send load to our send-later backend. If this increases the send-later load too much, it might cause delays in the regular send-later functionality and potentially other plugins like snooze that run under the same service. We would also need to rely on the network to be able to cancel a send, which would make it unusable offline or hard to debug if that specific request fails for any given reason.

This commit also refactors the way `ComposerExtension.sendActionConfig` works. The method has been renamed and now must return an array of send actions. Also, all of the business logic to handle different send actions registered by extensions has been pieced apart from the SendActionButton and into a new SendActionStore. This also enables undo send to undo custom send actions registered by extensions.
Along the way, this also fixes a pending TODO to show all registered custom send actions in the preferences for choosing the preferred send action for sending.

Undo send works via a task, so in case N1 closes before send goes through, it will still be persisted to the task queue and restored when opened again. Undoing a send means dequeuing this task.

Test Plan: Manual

Reviewers: jackie, bengotow, halla, evan

Reviewed By: bengotow, halla, evan

Differential Revision: https://phab.nylas.com/D3361
2016-10-26 20:40:10 -07:00
Ben Gotow 9ee3087d10 feat(tokens): Multi-select for tokenized text fields
Test Plan: Lots of tests, mostly updated to enzyme. Not many new ones.

Reviewers: evan, juan, jackie

Reviewed By: juan, jackie

Subscribers: juan

Differential Revision: https://phab.nylas.com/D3374
2016-10-26 13:58:57 -07:00
Ben Gotow ded52ce101 rm(grim): We’re not using Grim for deprecations 2016-10-25 11:36:20 -07:00
Ben Gotow d6f7984c82 fix(mailto): Support body with \n or \r characters
Related to #2923
2016-10-18 10:37:27 -07:00
Ben Gotow c20238314d lint(*): Bump to ESLint 3.8 2016-10-17 18:07:35 -07:00
Evan Morikawa 331dc59853 fix(spec):
Dramatically clean up and simply the spec bootup process.

Converting spec bootup system to es6 from coffee.

Converted old `jasmine-helper`, `spec-helper`, and `spec-suite` to a new
`n1-spec-runner` file.

Each of these old files had tons and tons of code related to various parts
of the spec bootup and running process.

Each of those parts have been extracted into individual files
2016-10-16 20:10:19 -07:00
Evan Morikawa a3303d4841 Fixes to spec-helper extraction 2016-10-16 20:10:19 -07:00
Evan Morikawa 76a9d8467f Initial extraction of all methods out of of spec-helper 2016-10-16 20:10:19 -07:00