Mailspring/spec/stores
Evan Morikawa 74e21bce16 feat(tasks): add Create, Update, Destroy tasks plus spec & lint fixes
Summary:
1. **Generic CUD Tasks**: There is now a generic `CreateModelTask`,
`UpdateModelTask`, and `DestroyModelTask`. These can either be used as-is
or trivially overridden to easily update simple objects. Hopefully all of
the boilerplate rollback, error handling, and undo logic won't have to be
re-duplicated on every task. There are also tests for these tasks. We use
them to perform mutating actions on `Metadata` objects.

1. **Failing on Promise Rejects**: Turns out that if a Promise rejected
due to an error or `Promise.reject` we were ignoring it and letting tests
pass. Now, tests will Fail if any unhandled promise rejects. This
uncovered a variety of errors throughout the test suite that had to be
fixed. The most significant one was during the `theme-manager` tests when
all packages (and their stores with async DB requests) was loaded. Long
after the `theme-manager` specs finished, those DB requests were
(somtimes) silently failing.

1. **Globally stub `DatabaseStore._query`**: All tests shouldn't actually
make queries on the database. Furthremore, the `inTransaction` block
doesn't resolve at all unless `_query` is stubbed. Instead of manually
remembering to do this in every test that touches the DB, it's now mocked
in `spec_helper`. This broke a handful of tests that needed to be manually
fixed.

1. **ESLint Fixes**: Some minor fixes to the linter config to prevent
yelling about minor ES6 things and ensuring we have the correct parser.

Test Plan: new tests

Reviewers: bengotow, juan, drew

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

Remove cloudState and N1-Send-Later
2016-01-15 15:16:21 -05:00
..
account-store-spec.coffee fix(accounts): Spec fixes for a03e8f70 2016-01-12 15:16:59 -08:00
contact-store-spec.coffee fix(regex): Chop leading '/" off emails if they are wrapped in quotes 2015-12-28 18:39:06 -08:00
database-setup-query-builder-spec.coffee fix(counts): Ensure serial execution of persistModels, unpersistModels 2015-11-25 12:17:00 -08:00
database-store-spec.coffee feat(tasks): add Create, Update, Destroy tasks plus spec & lint fixes 2016-01-15 15:16:21 -05:00
database-transaction-spec.coffee feat(transactions): Explicit (and faster) database transactions 2015-12-17 11:46:05 -08:00
draft-store-proxy-spec.coffee feat(tasks): add Create, Update, Destroy tasks plus spec & lint fixes 2016-01-15 15:16:21 -05:00
draft-store-spec.coffee feat(tasks): add Create, Update, Destroy tasks plus spec & lint fixes 2016-01-15 15:16:21 -05:00
file-download-store-spec.coffee fix(downloads): Escape all illegial path chars, don't make regex from path.sep 2016-01-12 13:52:01 -08:00
file-upload-store-spec.coffee refactor(env): new NylasEnv global 2015-11-17 16:41:20 -08:00
focused-contacts-store-spec.coffee
focused-content-store-spec.coffee
focused-mail-view-store-spec.coffee refactor(env): new NylasEnv global 2015-11-17 16:41:20 -08:00
message-store-spec.coffee feat(observables): Implementation of observables to replace some stores 2015-12-07 16:52:46 -08:00
task-queue-spec.coffee feat(observables): Implementation of observables to replace some stores 2015-12-07 16:52:46 -08:00
thread-counts-store-spec.coffee feat(tasks): add Create, Update, Destroy tasks plus spec & lint fixes 2016-01-15 15:16:21 -05:00
unread-badge-store-spec.coffee fix(badge): Badge respects option in prefs 2015-11-30 19:17:35 -08:00