From f0f4df6714bb36ce5ad679986ebef214b1a4b27e Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Tue, 2 Jun 2015 19:51:00 -0700 Subject: [PATCH] add(specs): +101 specs and 403 assertions from Atom --- build/tasks/prebuild-less-task.coffee | 4 +- dot-nylas/config.cson | 2 +- .../{light-ui => ui-dark}/CONTRIBUTING.md | 0 .../{light-ui => ui-dark}/LICENSE.md | 0 .../{light-ui => ui-dark}/README.md | 0 .../{light-ui => ui-dark}/index.less | 0 internal_packages/ui-dark/package.json | 11 + internal_packages/ui-light/CONTRIBUTING.md | 1 + internal_packages/ui-light/LICENSE.md | 20 ++ internal_packages/ui-light/README.md | 9 + .../ui-light/index.less | 0 .../{light-ui => ui-light}/package.json | 2 +- .../buffered-process-spec.coffee | 0 {spec => spec-nylas}/clipboard-spec.coffee | 0 spec-nylas/fixtures/css.css | 5 + spec-nylas/fixtures/module-cache/file.json | 3 + .../index.coffee | 0 .../index.coffee | 0 .../index.coffee | 0 .../index.coffee | 0 .../package.cson | 0 .../keymaps/broken.json | 0 .../package.json | 0 .../package-with-config-defaults/index.coffee | 0 .../package-with-config-schema/index.coffee | 0 .../index.coffee | 0 .../package.json | 0 .../package-with-deactivate/index.coffee | 0 .../index.coffee | 0 .../index.coffee | 0 .../package.json | 0 .../keymaps/keymap.cson | 0 .../package-with-empty-keymap/package.json | 0 .../package-with-empty-menu/menus/menu.cson | 0 .../package-with-empty-menu/package.json | 0 .../grammars/alittle.cson | 0 .../package-with-grammars/grammars/alot.cson | 0 .../main.js | 0 .../package.json | 0 .../packages/package-with-index/index.coffee | 0 .../grammars/grammar.cson | 0 .../package-with-invalid-styles/package.json | 0 .../styles/index.less | 0 .../keymaps/keymap-1.json | 0 .../keymaps/keymap-2.cson | 0 .../keymaps/keymap-3.cson | 0 .../package.cson | 0 .../keymaps/keymap-1.cson | 0 .../keymaps/keymap-2.cson | 0 .../keymaps/keymap-3.cjson | 0 .../package-with-main/main-module.coffee | 0 .../packages/package-with-main/package.cson | 0 .../menus/menu-1.cson | 0 .../menus/menu-2.cson | 0 .../menus/menu-3.cson | 0 .../package-with-menus-manifest/package.cson | 0 .../package-with-menus/menus/menu-1.cson | 0 .../package-with-menus/menus/menu-2.cson | 0 .../package-with-menus/menus/menu-3.cson | 0 .../index.coffee | 0 .../package.json | 0 .../package-with-serialization/index.coffee | 0 .../package-with-serialize-error/index.coffee | 0 .../package-with-serialize-error/package.cson | 0 .../package-with-settings/settings/omg.cson | 0 .../package.cson | 0 .../styles/1.css | 0 .../styles/2.less | 0 .../styles/3.css | 0 .../packages/package-with-styles/styles/1.css | 0 .../package-with-styles/styles/2.less | 0 .../styles/3.test-context.css | 0 .../packages/package-with-styles/styles/4.css | 0 .../package.cson | 0 .../package-without-module/package.cson | 0 .../package.json | 4 + .../styles/editor.less | 10 + .../styles/ui-variables.less | 2 + .../packages/theme-with-index-css/index.css | 0 .../theme-with-index-css/package.json | 0 .../packages/theme-with-index-less/index.less | 0 .../theme-with-index-less/package.json | 0 .../theme-with-invalid-styles/index.less | 1 + .../theme-with-invalid-styles/package.json | 4 + .../theme-with-package-file/package.json | 0 .../theme-with-package-file/styles/first.css | 0 .../theme-with-package-file/styles/last.css | 0 .../styles/second.less | 0 .../theme-with-syntax-variables/package.json | 0 .../styles/editor.less | 0 .../theme-with-ui-variables/package.json | 4 + .../styles/editor.less | 9 + .../styles/ui-variables.less | 75 +++++++ .../theme-without-package-file/styles/a.css | 0 .../theme-without-package-file/styles/b.css | 0 .../theme-without-package-file/styles/c.less | 0 .../theme-without-package-file/styles/d.csv | 0 spec-nylas/fixtures/sample.less | 8 + .../fixtures/task-spec-handler.coffee | 0 {spec => spec-nylas}/menu-manager-spec.coffee | 0 {spec => spec-nylas}/module-cache-spec.coffee | 6 +- .../nylas-protocol-handler-spec.coffee | 4 +- .../package-manager-spec.coffee | 83 +------ {spec => spec-nylas}/package-spec.coffee | 19 +- .../style-manager-spec.coffee | 0 .../styles-element-spec.coffee | 0 {spec => spec-nylas}/task-spec.coffee | 0 .../theme-manager-spec.coffee | 209 +++++++++--------- .../node_modules/native-module/main.js | 1 - .../node_modules/native-module/package.json | 4 - spec/spec-helper.coffee | 10 +- src/config-schema.coffee | 2 +- src/config.coffee | 2 +- src/theme-manager.coffee | 10 +- static/variables/ui-variables.less | 3 + static/workspace.less | 4 + 116 files changed, 315 insertions(+), 216 deletions(-) rename internal_packages/{light-ui => ui-dark}/CONTRIBUTING.md (100%) rename internal_packages/{light-ui => ui-dark}/LICENSE.md (100%) rename internal_packages/{light-ui => ui-dark}/README.md (100%) rename internal_packages/{light-ui => ui-dark}/index.less (100%) create mode 100644 internal_packages/ui-dark/package.json create mode 100644 internal_packages/ui-light/CONTRIBUTING.md create mode 100644 internal_packages/ui-light/LICENSE.md create mode 100644 internal_packages/ui-light/README.md rename spec/fixtures/packages/package-with-empty-keymap/keymaps/keymap.cson => internal_packages/ui-light/index.less (100%) rename internal_packages/{light-ui => ui-light}/package.json (88%) rename {spec => spec-nylas}/buffered-process-spec.coffee (100%) rename {spec => spec-nylas}/clipboard-spec.coffee (100%) create mode 100644 spec-nylas/fixtures/css.css create mode 100644 spec-nylas/fixtures/module-cache/file.json rename {spec => spec-nylas}/fixtures/packages/package-that-throws-an-exception/index.coffee (100%) rename {spec => spec-nylas}/fixtures/packages/package-that-throws-on-activate/index.coffee (100%) rename {spec => spec-nylas}/fixtures/packages/package-that-throws-on-deactivate/index.coffee (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-activation-commands/index.coffee (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-activation-commands/package.cson (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-broken-keymap/keymaps/broken.json (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-broken-package-json/package.json (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-config-defaults/index.coffee (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-config-schema/index.coffee (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-consumed-services/index.coffee (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-consumed-services/package.json (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-deactivate/index.coffee (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-deprecated-pane-item-method/index.coffee (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-empty-activation-commands/index.coffee (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-empty-activation-commands/package.json (100%) rename spec/fixtures/packages/package-with-empty-menu/menus/menu.cson => spec-nylas/fixtures/packages/package-with-empty-keymap/keymaps/keymap.cson (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-empty-keymap/package.json (100%) rename spec/fixtures/packages/package-with-incompatible-native-module/main.js => spec-nylas/fixtures/packages/package-with-empty-menu/menus/menu.cson (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-empty-menu/package.json (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-grammars/grammars/alittle.cson (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-grammars/grammars/alot.cson (100%) rename spec/fixtures/packages/package-with-incompatible-native-module/node_modules/native-module/build/Release/native.node => spec-nylas/fixtures/packages/package-with-incompatible-native-module/main.js (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-incompatible-native-module/package.json (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-index/index.coffee (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-injection-selector/grammars/grammar.cson (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-invalid-styles/package.json (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-invalid-styles/styles/index.less (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-keymaps-manifest/keymaps/keymap-1.json (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-keymaps-manifest/keymaps/keymap-2.cson (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-keymaps-manifest/keymaps/keymap-3.cson (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-keymaps-manifest/package.cson (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-keymaps/keymaps/keymap-1.cson (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-keymaps/keymaps/keymap-2.cson (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-keymaps/keymaps/keymap-3.cjson (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-main/main-module.coffee (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-main/package.cson (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-menus-manifest/menus/menu-1.cson (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-menus-manifest/menus/menu-2.cson (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-menus-manifest/menus/menu-3.cson (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-menus-manifest/package.cson (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-menus/menus/menu-1.cson (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-menus/menus/menu-2.cson (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-menus/menus/menu-3.cson (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-provided-services/index.coffee (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-provided-services/package.json (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-serialization/index.coffee (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-serialize-error/index.coffee (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-serialize-error/package.cson (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-settings/settings/omg.cson (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-style-sheets-manifest/package.cson (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-style-sheets-manifest/styles/1.css (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-style-sheets-manifest/styles/2.less (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-style-sheets-manifest/styles/3.css (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-styles/styles/1.css (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-styles/styles/2.less (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-styles/styles/3.test-context.css (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-styles/styles/4.css (100%) rename {spec => spec-nylas}/fixtures/packages/package-with-stylesheets-manifest/package.cson (100%) rename {spec => spec-nylas}/fixtures/packages/package-without-module/package.cson (100%) create mode 100755 spec-nylas/fixtures/packages/theme-with-incomplete-ui-variables/package.json create mode 100755 spec-nylas/fixtures/packages/theme-with-incomplete-ui-variables/styles/editor.less create mode 100755 spec-nylas/fixtures/packages/theme-with-incomplete-ui-variables/styles/ui-variables.less rename {spec => spec-nylas}/fixtures/packages/theme-with-index-css/index.css (100%) mode change 100644 => 100755 rename {spec => spec-nylas}/fixtures/packages/theme-with-index-css/package.json (100%) mode change 100644 => 100755 rename {spec => spec-nylas}/fixtures/packages/theme-with-index-less/index.less (100%) mode change 100644 => 100755 rename {spec => spec-nylas}/fixtures/packages/theme-with-index-less/package.json (100%) mode change 100644 => 100755 create mode 100755 spec-nylas/fixtures/packages/theme-with-invalid-styles/index.less create mode 100755 spec-nylas/fixtures/packages/theme-with-invalid-styles/package.json rename {spec => spec-nylas}/fixtures/packages/theme-with-package-file/package.json (100%) mode change 100644 => 100755 rename {spec => spec-nylas}/fixtures/packages/theme-with-package-file/styles/first.css (100%) mode change 100644 => 100755 rename {spec => spec-nylas}/fixtures/packages/theme-with-package-file/styles/last.css (100%) mode change 100644 => 100755 rename {spec => spec-nylas}/fixtures/packages/theme-with-package-file/styles/second.less (100%) mode change 100644 => 100755 rename {spec => spec-nylas}/fixtures/packages/theme-with-syntax-variables/package.json (100%) mode change 100644 => 100755 rename {spec => spec-nylas}/fixtures/packages/theme-with-syntax-variables/styles/editor.less (100%) mode change 100644 => 100755 create mode 100755 spec-nylas/fixtures/packages/theme-with-ui-variables/package.json create mode 100755 spec-nylas/fixtures/packages/theme-with-ui-variables/styles/editor.less create mode 100755 spec-nylas/fixtures/packages/theme-with-ui-variables/styles/ui-variables.less rename {spec => spec-nylas}/fixtures/packages/theme-without-package-file/styles/a.css (100%) mode change 100644 => 100755 rename {spec => spec-nylas}/fixtures/packages/theme-without-package-file/styles/b.css (100%) mode change 100644 => 100755 rename {spec => spec-nylas}/fixtures/packages/theme-without-package-file/styles/c.less (100%) mode change 100644 => 100755 rename {spec => spec-nylas}/fixtures/packages/theme-without-package-file/styles/d.csv (100%) mode change 100644 => 100755 create mode 100644 spec-nylas/fixtures/sample.less rename {spec => spec-nylas}/fixtures/task-spec-handler.coffee (100%) rename {spec => spec-nylas}/menu-manager-spec.coffee (100%) rename {spec => spec-nylas}/module-cache-spec.coffee (92%) rename spec/atom-protocol-handler-spec.coffee => spec-nylas/nylas-protocol-handler-spec.coffee (85%) rename {spec => spec-nylas}/package-manager-spec.coffee (87%) rename {spec => spec-nylas}/package-spec.coffee (83%) rename {spec => spec-nylas}/style-manager-spec.coffee (100%) rename {spec => spec-nylas}/styles-element-spec.coffee (100%) rename {spec => spec-nylas}/task-spec.coffee (100%) rename {spec => spec-nylas}/theme-manager-spec.coffee (72%) delete mode 100644 spec/fixtures/packages/package-with-incompatible-native-module/node_modules/native-module/main.js delete mode 100644 spec/fixtures/packages/package-with-incompatible-native-module/node_modules/native-module/package.json diff --git a/build/tasks/prebuild-less-task.coffee b/build/tasks/prebuild-less-task.coffee index ac7380bd3..fe605f621 100644 --- a/build/tasks/prebuild-less-task.coffee +++ b/build/tasks/prebuild-less-task.coffee @@ -6,7 +6,7 @@ LessCache = require 'less-cache' module.exports = (grunt) -> grunt.registerMultiTask 'prebuild-less', 'Prebuild cached of compiled LESS files', -> prebuiltConfigurations = [ - ['light-ui'] + ['ui-light', 'ui-dark'] ] directory = path.join(grunt.config.get('atom.appDir'), 'less-compile-cache') @@ -19,7 +19,7 @@ module.exports = (grunt) -> themePath = path.resolve('node_modules', theme) if fs.existsSync(themePath) is false themePath = path.resolve('internal_packages', theme) - + if fs.existsSync(path.join(themePath, 'stylesheets')) stylesheetsDir = path.join(themePath, 'stylesheets') else diff --git a/dot-nylas/config.cson b/dot-nylas/config.cson index a28d5e6fb..03a2ca6c7 100644 --- a/dot-nylas/config.cson +++ b/dot-nylas/config.cson @@ -1,7 +1,7 @@ 'global': 'core': 'themes': [ - 'light-ui' + 'ui-light' ] 'disabledPackages': [ "calendar-bar", diff --git a/internal_packages/light-ui/CONTRIBUTING.md b/internal_packages/ui-dark/CONTRIBUTING.md similarity index 100% rename from internal_packages/light-ui/CONTRIBUTING.md rename to internal_packages/ui-dark/CONTRIBUTING.md diff --git a/internal_packages/light-ui/LICENSE.md b/internal_packages/ui-dark/LICENSE.md similarity index 100% rename from internal_packages/light-ui/LICENSE.md rename to internal_packages/ui-dark/LICENSE.md diff --git a/internal_packages/light-ui/README.md b/internal_packages/ui-dark/README.md similarity index 100% rename from internal_packages/light-ui/README.md rename to internal_packages/ui-dark/README.md diff --git a/internal_packages/light-ui/index.less b/internal_packages/ui-dark/index.less similarity index 100% rename from internal_packages/light-ui/index.less rename to internal_packages/ui-dark/index.less diff --git a/internal_packages/ui-dark/package.json b/internal_packages/ui-dark/package.json new file mode 100644 index 000000000..4f7b4fc46 --- /dev/null +++ b/internal_packages/ui-dark/package.json @@ -0,0 +1,11 @@ +{ + "name": "ui-dark", + "theme": "ui", + "version": "0.1.0", + "description": "The Dark Nylas Mail Client Theme", + "license": "Proprietary", + "engines": { + "atom": "*" + }, + "private": true +} diff --git a/internal_packages/ui-light/CONTRIBUTING.md b/internal_packages/ui-light/CONTRIBUTING.md new file mode 100644 index 000000000..0fd0ad696 --- /dev/null +++ b/internal_packages/ui-light/CONTRIBUTING.md @@ -0,0 +1 @@ +See the [Atom contributing guide](https://github.com/atom/atom/blob/master/CONTRIBUTING.md) diff --git a/internal_packages/ui-light/LICENSE.md b/internal_packages/ui-light/LICENSE.md new file mode 100644 index 000000000..4d231b456 --- /dev/null +++ b/internal_packages/ui-light/LICENSE.md @@ -0,0 +1,20 @@ +Copyright (c) 2014 GitHub Inc. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/internal_packages/ui-light/README.md b/internal_packages/ui-light/README.md new file mode 100644 index 000000000..ad0c13a17 --- /dev/null +++ b/internal_packages/ui-light/README.md @@ -0,0 +1,9 @@ +# Atom Light UI theme + +Default light UI theme for Atom. + +This theme is installed by default with Atom and can be activated by going to +the _Themes_ section in the Settings view (`cmd-,`) and selecting it from the +_UI Themes_ drop-down menu. + +![](https://f.cloud.github.com/assets/671378/2265022/bb148a20-9e7a-11e3-81c8-bf5965d48183.png) diff --git a/spec/fixtures/packages/package-with-empty-keymap/keymaps/keymap.cson b/internal_packages/ui-light/index.less similarity index 100% rename from spec/fixtures/packages/package-with-empty-keymap/keymaps/keymap.cson rename to internal_packages/ui-light/index.less diff --git a/internal_packages/light-ui/package.json b/internal_packages/ui-light/package.json similarity index 88% rename from internal_packages/light-ui/package.json rename to internal_packages/ui-light/package.json index d0a8f260b..c0e0c2300 100644 --- a/internal_packages/light-ui/package.json +++ b/internal_packages/ui-light/package.json @@ -1,5 +1,5 @@ { - "name": "light-ui", + "name": "ui-light", "theme": "ui", "version": "0.1.0", "description": "The Nylas Mail Client Theme", diff --git a/spec/buffered-process-spec.coffee b/spec-nylas/buffered-process-spec.coffee similarity index 100% rename from spec/buffered-process-spec.coffee rename to spec-nylas/buffered-process-spec.coffee diff --git a/spec/clipboard-spec.coffee b/spec-nylas/clipboard-spec.coffee similarity index 100% rename from spec/clipboard-spec.coffee rename to spec-nylas/clipboard-spec.coffee diff --git a/spec-nylas/fixtures/css.css b/spec-nylas/fixtures/css.css new file mode 100644 index 000000000..d5ae97e68 --- /dev/null +++ b/spec-nylas/fixtures/css.css @@ -0,0 +1,5 @@ +body { + font-size: 1234px; + width: 110%; + font-weight: bold !important; +} diff --git a/spec-nylas/fixtures/module-cache/file.json b/spec-nylas/fixtures/module-cache/file.json new file mode 100644 index 000000000..c8c4105eb --- /dev/null +++ b/spec-nylas/fixtures/module-cache/file.json @@ -0,0 +1,3 @@ +{ + "foo": "bar" +} diff --git a/spec/fixtures/packages/package-that-throws-an-exception/index.coffee b/spec-nylas/fixtures/packages/package-that-throws-an-exception/index.coffee similarity index 100% rename from spec/fixtures/packages/package-that-throws-an-exception/index.coffee rename to spec-nylas/fixtures/packages/package-that-throws-an-exception/index.coffee diff --git a/spec/fixtures/packages/package-that-throws-on-activate/index.coffee b/spec-nylas/fixtures/packages/package-that-throws-on-activate/index.coffee similarity index 100% rename from spec/fixtures/packages/package-that-throws-on-activate/index.coffee rename to spec-nylas/fixtures/packages/package-that-throws-on-activate/index.coffee diff --git a/spec/fixtures/packages/package-that-throws-on-deactivate/index.coffee b/spec-nylas/fixtures/packages/package-that-throws-on-deactivate/index.coffee similarity index 100% rename from spec/fixtures/packages/package-that-throws-on-deactivate/index.coffee rename to spec-nylas/fixtures/packages/package-that-throws-on-deactivate/index.coffee diff --git a/spec/fixtures/packages/package-with-activation-commands/index.coffee b/spec-nylas/fixtures/packages/package-with-activation-commands/index.coffee similarity index 100% rename from spec/fixtures/packages/package-with-activation-commands/index.coffee rename to spec-nylas/fixtures/packages/package-with-activation-commands/index.coffee diff --git a/spec/fixtures/packages/package-with-activation-commands/package.cson b/spec-nylas/fixtures/packages/package-with-activation-commands/package.cson similarity index 100% rename from spec/fixtures/packages/package-with-activation-commands/package.cson rename to spec-nylas/fixtures/packages/package-with-activation-commands/package.cson diff --git a/spec/fixtures/packages/package-with-broken-keymap/keymaps/broken.json b/spec-nylas/fixtures/packages/package-with-broken-keymap/keymaps/broken.json similarity index 100% rename from spec/fixtures/packages/package-with-broken-keymap/keymaps/broken.json rename to spec-nylas/fixtures/packages/package-with-broken-keymap/keymaps/broken.json diff --git a/spec/fixtures/packages/package-with-broken-package-json/package.json b/spec-nylas/fixtures/packages/package-with-broken-package-json/package.json similarity index 100% rename from spec/fixtures/packages/package-with-broken-package-json/package.json rename to spec-nylas/fixtures/packages/package-with-broken-package-json/package.json diff --git a/spec/fixtures/packages/package-with-config-defaults/index.coffee b/spec-nylas/fixtures/packages/package-with-config-defaults/index.coffee similarity index 100% rename from spec/fixtures/packages/package-with-config-defaults/index.coffee rename to spec-nylas/fixtures/packages/package-with-config-defaults/index.coffee diff --git a/spec/fixtures/packages/package-with-config-schema/index.coffee b/spec-nylas/fixtures/packages/package-with-config-schema/index.coffee similarity index 100% rename from spec/fixtures/packages/package-with-config-schema/index.coffee rename to spec-nylas/fixtures/packages/package-with-config-schema/index.coffee diff --git a/spec/fixtures/packages/package-with-consumed-services/index.coffee b/spec-nylas/fixtures/packages/package-with-consumed-services/index.coffee similarity index 100% rename from spec/fixtures/packages/package-with-consumed-services/index.coffee rename to spec-nylas/fixtures/packages/package-with-consumed-services/index.coffee diff --git a/spec/fixtures/packages/package-with-consumed-services/package.json b/spec-nylas/fixtures/packages/package-with-consumed-services/package.json similarity index 100% rename from spec/fixtures/packages/package-with-consumed-services/package.json rename to spec-nylas/fixtures/packages/package-with-consumed-services/package.json diff --git a/spec/fixtures/packages/package-with-deactivate/index.coffee b/spec-nylas/fixtures/packages/package-with-deactivate/index.coffee similarity index 100% rename from spec/fixtures/packages/package-with-deactivate/index.coffee rename to spec-nylas/fixtures/packages/package-with-deactivate/index.coffee diff --git a/spec/fixtures/packages/package-with-deprecated-pane-item-method/index.coffee b/spec-nylas/fixtures/packages/package-with-deprecated-pane-item-method/index.coffee similarity index 100% rename from spec/fixtures/packages/package-with-deprecated-pane-item-method/index.coffee rename to spec-nylas/fixtures/packages/package-with-deprecated-pane-item-method/index.coffee diff --git a/spec/fixtures/packages/package-with-empty-activation-commands/index.coffee b/spec-nylas/fixtures/packages/package-with-empty-activation-commands/index.coffee similarity index 100% rename from spec/fixtures/packages/package-with-empty-activation-commands/index.coffee rename to spec-nylas/fixtures/packages/package-with-empty-activation-commands/index.coffee diff --git a/spec/fixtures/packages/package-with-empty-activation-commands/package.json b/spec-nylas/fixtures/packages/package-with-empty-activation-commands/package.json similarity index 100% rename from spec/fixtures/packages/package-with-empty-activation-commands/package.json rename to spec-nylas/fixtures/packages/package-with-empty-activation-commands/package.json diff --git a/spec/fixtures/packages/package-with-empty-menu/menus/menu.cson b/spec-nylas/fixtures/packages/package-with-empty-keymap/keymaps/keymap.cson similarity index 100% rename from spec/fixtures/packages/package-with-empty-menu/menus/menu.cson rename to spec-nylas/fixtures/packages/package-with-empty-keymap/keymaps/keymap.cson diff --git a/spec/fixtures/packages/package-with-empty-keymap/package.json b/spec-nylas/fixtures/packages/package-with-empty-keymap/package.json similarity index 100% rename from spec/fixtures/packages/package-with-empty-keymap/package.json rename to spec-nylas/fixtures/packages/package-with-empty-keymap/package.json diff --git a/spec/fixtures/packages/package-with-incompatible-native-module/main.js b/spec-nylas/fixtures/packages/package-with-empty-menu/menus/menu.cson similarity index 100% rename from spec/fixtures/packages/package-with-incompatible-native-module/main.js rename to spec-nylas/fixtures/packages/package-with-empty-menu/menus/menu.cson diff --git a/spec/fixtures/packages/package-with-empty-menu/package.json b/spec-nylas/fixtures/packages/package-with-empty-menu/package.json similarity index 100% rename from spec/fixtures/packages/package-with-empty-menu/package.json rename to spec-nylas/fixtures/packages/package-with-empty-menu/package.json diff --git a/spec/fixtures/packages/package-with-grammars/grammars/alittle.cson b/spec-nylas/fixtures/packages/package-with-grammars/grammars/alittle.cson similarity index 100% rename from spec/fixtures/packages/package-with-grammars/grammars/alittle.cson rename to spec-nylas/fixtures/packages/package-with-grammars/grammars/alittle.cson diff --git a/spec/fixtures/packages/package-with-grammars/grammars/alot.cson b/spec-nylas/fixtures/packages/package-with-grammars/grammars/alot.cson similarity index 100% rename from spec/fixtures/packages/package-with-grammars/grammars/alot.cson rename to spec-nylas/fixtures/packages/package-with-grammars/grammars/alot.cson diff --git a/spec/fixtures/packages/package-with-incompatible-native-module/node_modules/native-module/build/Release/native.node b/spec-nylas/fixtures/packages/package-with-incompatible-native-module/main.js similarity index 100% rename from spec/fixtures/packages/package-with-incompatible-native-module/node_modules/native-module/build/Release/native.node rename to spec-nylas/fixtures/packages/package-with-incompatible-native-module/main.js diff --git a/spec/fixtures/packages/package-with-incompatible-native-module/package.json b/spec-nylas/fixtures/packages/package-with-incompatible-native-module/package.json similarity index 100% rename from spec/fixtures/packages/package-with-incompatible-native-module/package.json rename to spec-nylas/fixtures/packages/package-with-incompatible-native-module/package.json diff --git a/spec/fixtures/packages/package-with-index/index.coffee b/spec-nylas/fixtures/packages/package-with-index/index.coffee similarity index 100% rename from spec/fixtures/packages/package-with-index/index.coffee rename to spec-nylas/fixtures/packages/package-with-index/index.coffee diff --git a/spec/fixtures/packages/package-with-injection-selector/grammars/grammar.cson b/spec-nylas/fixtures/packages/package-with-injection-selector/grammars/grammar.cson similarity index 100% rename from spec/fixtures/packages/package-with-injection-selector/grammars/grammar.cson rename to spec-nylas/fixtures/packages/package-with-injection-selector/grammars/grammar.cson diff --git a/spec/fixtures/packages/package-with-invalid-styles/package.json b/spec-nylas/fixtures/packages/package-with-invalid-styles/package.json similarity index 100% rename from spec/fixtures/packages/package-with-invalid-styles/package.json rename to spec-nylas/fixtures/packages/package-with-invalid-styles/package.json diff --git a/spec/fixtures/packages/package-with-invalid-styles/styles/index.less b/spec-nylas/fixtures/packages/package-with-invalid-styles/styles/index.less similarity index 100% rename from spec/fixtures/packages/package-with-invalid-styles/styles/index.less rename to spec-nylas/fixtures/packages/package-with-invalid-styles/styles/index.less diff --git a/spec/fixtures/packages/package-with-keymaps-manifest/keymaps/keymap-1.json b/spec-nylas/fixtures/packages/package-with-keymaps-manifest/keymaps/keymap-1.json similarity index 100% rename from spec/fixtures/packages/package-with-keymaps-manifest/keymaps/keymap-1.json rename to spec-nylas/fixtures/packages/package-with-keymaps-manifest/keymaps/keymap-1.json diff --git a/spec/fixtures/packages/package-with-keymaps-manifest/keymaps/keymap-2.cson b/spec-nylas/fixtures/packages/package-with-keymaps-manifest/keymaps/keymap-2.cson similarity index 100% rename from spec/fixtures/packages/package-with-keymaps-manifest/keymaps/keymap-2.cson rename to spec-nylas/fixtures/packages/package-with-keymaps-manifest/keymaps/keymap-2.cson diff --git a/spec/fixtures/packages/package-with-keymaps-manifest/keymaps/keymap-3.cson b/spec-nylas/fixtures/packages/package-with-keymaps-manifest/keymaps/keymap-3.cson similarity index 100% rename from spec/fixtures/packages/package-with-keymaps-manifest/keymaps/keymap-3.cson rename to spec-nylas/fixtures/packages/package-with-keymaps-manifest/keymaps/keymap-3.cson diff --git a/spec/fixtures/packages/package-with-keymaps-manifest/package.cson b/spec-nylas/fixtures/packages/package-with-keymaps-manifest/package.cson similarity index 100% rename from spec/fixtures/packages/package-with-keymaps-manifest/package.cson rename to spec-nylas/fixtures/packages/package-with-keymaps-manifest/package.cson diff --git a/spec/fixtures/packages/package-with-keymaps/keymaps/keymap-1.cson b/spec-nylas/fixtures/packages/package-with-keymaps/keymaps/keymap-1.cson similarity index 100% rename from spec/fixtures/packages/package-with-keymaps/keymaps/keymap-1.cson rename to spec-nylas/fixtures/packages/package-with-keymaps/keymaps/keymap-1.cson diff --git a/spec/fixtures/packages/package-with-keymaps/keymaps/keymap-2.cson b/spec-nylas/fixtures/packages/package-with-keymaps/keymaps/keymap-2.cson similarity index 100% rename from spec/fixtures/packages/package-with-keymaps/keymaps/keymap-2.cson rename to spec-nylas/fixtures/packages/package-with-keymaps/keymaps/keymap-2.cson diff --git a/spec/fixtures/packages/package-with-keymaps/keymaps/keymap-3.cjson b/spec-nylas/fixtures/packages/package-with-keymaps/keymaps/keymap-3.cjson similarity index 100% rename from spec/fixtures/packages/package-with-keymaps/keymaps/keymap-3.cjson rename to spec-nylas/fixtures/packages/package-with-keymaps/keymaps/keymap-3.cjson diff --git a/spec/fixtures/packages/package-with-main/main-module.coffee b/spec-nylas/fixtures/packages/package-with-main/main-module.coffee similarity index 100% rename from spec/fixtures/packages/package-with-main/main-module.coffee rename to spec-nylas/fixtures/packages/package-with-main/main-module.coffee diff --git a/spec/fixtures/packages/package-with-main/package.cson b/spec-nylas/fixtures/packages/package-with-main/package.cson similarity index 100% rename from spec/fixtures/packages/package-with-main/package.cson rename to spec-nylas/fixtures/packages/package-with-main/package.cson diff --git a/spec/fixtures/packages/package-with-menus-manifest/menus/menu-1.cson b/spec-nylas/fixtures/packages/package-with-menus-manifest/menus/menu-1.cson similarity index 100% rename from spec/fixtures/packages/package-with-menus-manifest/menus/menu-1.cson rename to spec-nylas/fixtures/packages/package-with-menus-manifest/menus/menu-1.cson diff --git a/spec/fixtures/packages/package-with-menus-manifest/menus/menu-2.cson b/spec-nylas/fixtures/packages/package-with-menus-manifest/menus/menu-2.cson similarity index 100% rename from spec/fixtures/packages/package-with-menus-manifest/menus/menu-2.cson rename to spec-nylas/fixtures/packages/package-with-menus-manifest/menus/menu-2.cson diff --git a/spec/fixtures/packages/package-with-menus-manifest/menus/menu-3.cson b/spec-nylas/fixtures/packages/package-with-menus-manifest/menus/menu-3.cson similarity index 100% rename from spec/fixtures/packages/package-with-menus-manifest/menus/menu-3.cson rename to spec-nylas/fixtures/packages/package-with-menus-manifest/menus/menu-3.cson diff --git a/spec/fixtures/packages/package-with-menus-manifest/package.cson b/spec-nylas/fixtures/packages/package-with-menus-manifest/package.cson similarity index 100% rename from spec/fixtures/packages/package-with-menus-manifest/package.cson rename to spec-nylas/fixtures/packages/package-with-menus-manifest/package.cson diff --git a/spec/fixtures/packages/package-with-menus/menus/menu-1.cson b/spec-nylas/fixtures/packages/package-with-menus/menus/menu-1.cson similarity index 100% rename from spec/fixtures/packages/package-with-menus/menus/menu-1.cson rename to spec-nylas/fixtures/packages/package-with-menus/menus/menu-1.cson diff --git a/spec/fixtures/packages/package-with-menus/menus/menu-2.cson b/spec-nylas/fixtures/packages/package-with-menus/menus/menu-2.cson similarity index 100% rename from spec/fixtures/packages/package-with-menus/menus/menu-2.cson rename to spec-nylas/fixtures/packages/package-with-menus/menus/menu-2.cson diff --git a/spec/fixtures/packages/package-with-menus/menus/menu-3.cson b/spec-nylas/fixtures/packages/package-with-menus/menus/menu-3.cson similarity index 100% rename from spec/fixtures/packages/package-with-menus/menus/menu-3.cson rename to spec-nylas/fixtures/packages/package-with-menus/menus/menu-3.cson diff --git a/spec/fixtures/packages/package-with-provided-services/index.coffee b/spec-nylas/fixtures/packages/package-with-provided-services/index.coffee similarity index 100% rename from spec/fixtures/packages/package-with-provided-services/index.coffee rename to spec-nylas/fixtures/packages/package-with-provided-services/index.coffee diff --git a/spec/fixtures/packages/package-with-provided-services/package.json b/spec-nylas/fixtures/packages/package-with-provided-services/package.json similarity index 100% rename from spec/fixtures/packages/package-with-provided-services/package.json rename to spec-nylas/fixtures/packages/package-with-provided-services/package.json diff --git a/spec/fixtures/packages/package-with-serialization/index.coffee b/spec-nylas/fixtures/packages/package-with-serialization/index.coffee similarity index 100% rename from spec/fixtures/packages/package-with-serialization/index.coffee rename to spec-nylas/fixtures/packages/package-with-serialization/index.coffee diff --git a/spec/fixtures/packages/package-with-serialize-error/index.coffee b/spec-nylas/fixtures/packages/package-with-serialize-error/index.coffee similarity index 100% rename from spec/fixtures/packages/package-with-serialize-error/index.coffee rename to spec-nylas/fixtures/packages/package-with-serialize-error/index.coffee diff --git a/spec/fixtures/packages/package-with-serialize-error/package.cson b/spec-nylas/fixtures/packages/package-with-serialize-error/package.cson similarity index 100% rename from spec/fixtures/packages/package-with-serialize-error/package.cson rename to spec-nylas/fixtures/packages/package-with-serialize-error/package.cson diff --git a/spec/fixtures/packages/package-with-settings/settings/omg.cson b/spec-nylas/fixtures/packages/package-with-settings/settings/omg.cson similarity index 100% rename from spec/fixtures/packages/package-with-settings/settings/omg.cson rename to spec-nylas/fixtures/packages/package-with-settings/settings/omg.cson diff --git a/spec/fixtures/packages/package-with-style-sheets-manifest/package.cson b/spec-nylas/fixtures/packages/package-with-style-sheets-manifest/package.cson similarity index 100% rename from spec/fixtures/packages/package-with-style-sheets-manifest/package.cson rename to spec-nylas/fixtures/packages/package-with-style-sheets-manifest/package.cson diff --git a/spec/fixtures/packages/package-with-style-sheets-manifest/styles/1.css b/spec-nylas/fixtures/packages/package-with-style-sheets-manifest/styles/1.css similarity index 100% rename from spec/fixtures/packages/package-with-style-sheets-manifest/styles/1.css rename to spec-nylas/fixtures/packages/package-with-style-sheets-manifest/styles/1.css diff --git a/spec/fixtures/packages/package-with-style-sheets-manifest/styles/2.less b/spec-nylas/fixtures/packages/package-with-style-sheets-manifest/styles/2.less similarity index 100% rename from spec/fixtures/packages/package-with-style-sheets-manifest/styles/2.less rename to spec-nylas/fixtures/packages/package-with-style-sheets-manifest/styles/2.less diff --git a/spec/fixtures/packages/package-with-style-sheets-manifest/styles/3.css b/spec-nylas/fixtures/packages/package-with-style-sheets-manifest/styles/3.css similarity index 100% rename from spec/fixtures/packages/package-with-style-sheets-manifest/styles/3.css rename to spec-nylas/fixtures/packages/package-with-style-sheets-manifest/styles/3.css diff --git a/spec/fixtures/packages/package-with-styles/styles/1.css b/spec-nylas/fixtures/packages/package-with-styles/styles/1.css similarity index 100% rename from spec/fixtures/packages/package-with-styles/styles/1.css rename to spec-nylas/fixtures/packages/package-with-styles/styles/1.css diff --git a/spec/fixtures/packages/package-with-styles/styles/2.less b/spec-nylas/fixtures/packages/package-with-styles/styles/2.less similarity index 100% rename from spec/fixtures/packages/package-with-styles/styles/2.less rename to spec-nylas/fixtures/packages/package-with-styles/styles/2.less diff --git a/spec/fixtures/packages/package-with-styles/styles/3.test-context.css b/spec-nylas/fixtures/packages/package-with-styles/styles/3.test-context.css similarity index 100% rename from spec/fixtures/packages/package-with-styles/styles/3.test-context.css rename to spec-nylas/fixtures/packages/package-with-styles/styles/3.test-context.css diff --git a/spec/fixtures/packages/package-with-styles/styles/4.css b/spec-nylas/fixtures/packages/package-with-styles/styles/4.css similarity index 100% rename from spec/fixtures/packages/package-with-styles/styles/4.css rename to spec-nylas/fixtures/packages/package-with-styles/styles/4.css diff --git a/spec/fixtures/packages/package-with-stylesheets-manifest/package.cson b/spec-nylas/fixtures/packages/package-with-stylesheets-manifest/package.cson similarity index 100% rename from spec/fixtures/packages/package-with-stylesheets-manifest/package.cson rename to spec-nylas/fixtures/packages/package-with-stylesheets-manifest/package.cson diff --git a/spec/fixtures/packages/package-without-module/package.cson b/spec-nylas/fixtures/packages/package-without-module/package.cson similarity index 100% rename from spec/fixtures/packages/package-without-module/package.cson rename to spec-nylas/fixtures/packages/package-without-module/package.cson diff --git a/spec-nylas/fixtures/packages/theme-with-incomplete-ui-variables/package.json b/spec-nylas/fixtures/packages/theme-with-incomplete-ui-variables/package.json new file mode 100755 index 000000000..b62d9ab61 --- /dev/null +++ b/spec-nylas/fixtures/packages/theme-with-incomplete-ui-variables/package.json @@ -0,0 +1,4 @@ +{ + "theme": "ui", + "styleSheets": ["editor.less"] +} diff --git a/spec-nylas/fixtures/packages/theme-with-incomplete-ui-variables/styles/editor.less b/spec-nylas/fixtures/packages/theme-with-incomplete-ui-variables/styles/editor.less new file mode 100755 index 000000000..f7e8bd41d --- /dev/null +++ b/spec-nylas/fixtures/packages/theme-with-incomplete-ui-variables/styles/editor.less @@ -0,0 +1,10 @@ +@import "ui-variables"; + +atom-text-editor { + padding-top: @component-padding; + padding-right: @component-padding; + padding-bottom: @component-padding; + + color: @input-background-color; + background-color: @spec-test-variable; // From the fallback variables, not overridden +} diff --git a/spec-nylas/fixtures/packages/theme-with-incomplete-ui-variables/styles/ui-variables.less b/spec-nylas/fixtures/packages/theme-with-incomplete-ui-variables/styles/ui-variables.less new file mode 100755 index 000000000..2fbc8d8b2 --- /dev/null +++ b/spec-nylas/fixtures/packages/theme-with-incomplete-ui-variables/styles/ui-variables.less @@ -0,0 +1,2 @@ +// This does not contain all of the ui-variables available. +@background-primary: #00f; // Changed diff --git a/spec/fixtures/packages/theme-with-index-css/index.css b/spec-nylas/fixtures/packages/theme-with-index-css/index.css old mode 100644 new mode 100755 similarity index 100% rename from spec/fixtures/packages/theme-with-index-css/index.css rename to spec-nylas/fixtures/packages/theme-with-index-css/index.css diff --git a/spec/fixtures/packages/theme-with-index-css/package.json b/spec-nylas/fixtures/packages/theme-with-index-css/package.json old mode 100644 new mode 100755 similarity index 100% rename from spec/fixtures/packages/theme-with-index-css/package.json rename to spec-nylas/fixtures/packages/theme-with-index-css/package.json diff --git a/spec/fixtures/packages/theme-with-index-less/index.less b/spec-nylas/fixtures/packages/theme-with-index-less/index.less old mode 100644 new mode 100755 similarity index 100% rename from spec/fixtures/packages/theme-with-index-less/index.less rename to spec-nylas/fixtures/packages/theme-with-index-less/index.less diff --git a/spec/fixtures/packages/theme-with-index-less/package.json b/spec-nylas/fixtures/packages/theme-with-index-less/package.json old mode 100644 new mode 100755 similarity index 100% rename from spec/fixtures/packages/theme-with-index-less/package.json rename to spec-nylas/fixtures/packages/theme-with-index-less/package.json diff --git a/spec-nylas/fixtures/packages/theme-with-invalid-styles/index.less b/spec-nylas/fixtures/packages/theme-with-invalid-styles/index.less new file mode 100755 index 000000000..b554d9e46 --- /dev/null +++ b/spec-nylas/fixtures/packages/theme-with-invalid-styles/index.less @@ -0,0 +1 @@ +<> diff --git a/spec-nylas/fixtures/packages/theme-with-invalid-styles/package.json b/spec-nylas/fixtures/packages/theme-with-invalid-styles/package.json new file mode 100755 index 000000000..1dd1ee48b --- /dev/null +++ b/spec-nylas/fixtures/packages/theme-with-invalid-styles/package.json @@ -0,0 +1,4 @@ +{ + "name": "theme-with-invalid-styles", + "theme": "ui" +} diff --git a/spec/fixtures/packages/theme-with-package-file/package.json b/spec-nylas/fixtures/packages/theme-with-package-file/package.json old mode 100644 new mode 100755 similarity index 100% rename from spec/fixtures/packages/theme-with-package-file/package.json rename to spec-nylas/fixtures/packages/theme-with-package-file/package.json diff --git a/spec/fixtures/packages/theme-with-package-file/styles/first.css b/spec-nylas/fixtures/packages/theme-with-package-file/styles/first.css old mode 100644 new mode 100755 similarity index 100% rename from spec/fixtures/packages/theme-with-package-file/styles/first.css rename to spec-nylas/fixtures/packages/theme-with-package-file/styles/first.css diff --git a/spec/fixtures/packages/theme-with-package-file/styles/last.css b/spec-nylas/fixtures/packages/theme-with-package-file/styles/last.css old mode 100644 new mode 100755 similarity index 100% rename from spec/fixtures/packages/theme-with-package-file/styles/last.css rename to spec-nylas/fixtures/packages/theme-with-package-file/styles/last.css diff --git a/spec/fixtures/packages/theme-with-package-file/styles/second.less b/spec-nylas/fixtures/packages/theme-with-package-file/styles/second.less old mode 100644 new mode 100755 similarity index 100% rename from spec/fixtures/packages/theme-with-package-file/styles/second.less rename to spec-nylas/fixtures/packages/theme-with-package-file/styles/second.less diff --git a/spec/fixtures/packages/theme-with-syntax-variables/package.json b/spec-nylas/fixtures/packages/theme-with-syntax-variables/package.json old mode 100644 new mode 100755 similarity index 100% rename from spec/fixtures/packages/theme-with-syntax-variables/package.json rename to spec-nylas/fixtures/packages/theme-with-syntax-variables/package.json diff --git a/spec/fixtures/packages/theme-with-syntax-variables/styles/editor.less b/spec-nylas/fixtures/packages/theme-with-syntax-variables/styles/editor.less old mode 100644 new mode 100755 similarity index 100% rename from spec/fixtures/packages/theme-with-syntax-variables/styles/editor.less rename to spec-nylas/fixtures/packages/theme-with-syntax-variables/styles/editor.less diff --git a/spec-nylas/fixtures/packages/theme-with-ui-variables/package.json b/spec-nylas/fixtures/packages/theme-with-ui-variables/package.json new file mode 100755 index 000000000..b62d9ab61 --- /dev/null +++ b/spec-nylas/fixtures/packages/theme-with-ui-variables/package.json @@ -0,0 +1,4 @@ +{ + "theme": "ui", + "styleSheets": ["editor.less"] +} diff --git a/spec-nylas/fixtures/packages/theme-with-ui-variables/styles/editor.less b/spec-nylas/fixtures/packages/theme-with-ui-variables/styles/editor.less new file mode 100755 index 000000000..8f32addd3 --- /dev/null +++ b/spec-nylas/fixtures/packages/theme-with-ui-variables/styles/editor.less @@ -0,0 +1,9 @@ +@import "ui-variables"; + +atom-text-editor { + padding-top: @component-padding; + padding-right: @component-padding; + padding-bottom: @component-padding; + + color: @input-background-color; +} diff --git a/spec-nylas/fixtures/packages/theme-with-ui-variables/styles/ui-variables.less b/spec-nylas/fixtures/packages/theme-with-ui-variables/styles/ui-variables.less new file mode 100755 index 000000000..b7343c436 --- /dev/null +++ b/spec-nylas/fixtures/packages/theme-with-ui-variables/styles/ui-variables.less @@ -0,0 +1,75 @@ +// Variables different from the original are marked 'Changed' + +@text-color: #333; +@text-color-subtle: #777; +@text-color-highlight: #111; +@text-color-selected: @text-color-highlight; + +@text-color-info: #5293d8; +@text-color-success: #1fe977; +@text-color-warning: #f78a46; +@text-color-error: #c00; + +@background-color-info: #0098ff; +@background-color-success: #17ca65; +@background-color-warning: #ff4800; +@background-color-error: #c00; +@background-color-highlight: rgba(255, 255, 255, 0.10); +@background-color-selected: @background-color-highlight; + +@background-primary: #00f; // Changed + +@base-background-color: #fff; +@base-border-color: #eee; + +@pane-item-background-color: @base-background-color; +@pane-item-border-color: @base-border-color; + +@input-background-color: #f00; // Changed +@input-border-color: @base-border-color; + +@tool-panel-background-color: #f4f4f4; +@tool-panel-border-color: @base-border-color; + +@inset-panel-background-color: #eee; +@inset-panel-border-color: @base-border-color; + +@panel-heading-background-color: #ddd; +@panel-heading-border-color: transparent; + +@overlay-background-color: #f4f4f4; +@overlay-border-color: @base-border-color; + +@button-background-color: #ccc; +@button-background-color-hover: lighten(@button-background-color, 5%); +@button-background-color-selected: @button-background-color-hover; +@button-border-color: #aaa; + +@tab-bar-background-color: #fff; +@tab-bar-border-color: darken(@tab-background-color-active, 10%); +@tab-background-color: #f4f4f4; +@tab-background-color-active: #fff; +@tab-border-color: @base-border-color; + +@tree-view-background-color: @tool-panel-background-color; +@tree-view-border-color: @tool-panel-border-color; + +@ui-site-color-1: @background-color-success; // green +@ui-site-color-2: @background-color-info; // blue +@ui-site-color-3: @background-color-warning; // orange +@ui-site-color-4: #db2ff4; // purple +@ui-site-color-5: #f5e11d; // yellow + +@font-size: 12px; + +@disclosure-arrow-size: 12px; + +@component-padding: 150px; +@component-icon-padding: 5px; +@component-icon-size: 16px; +@component-line-height: 25px; +@component-border-radius: 2px; + +@tab-height: 30px; + +@font-family: Arial; diff --git a/spec/fixtures/packages/theme-without-package-file/styles/a.css b/spec-nylas/fixtures/packages/theme-without-package-file/styles/a.css old mode 100644 new mode 100755 similarity index 100% rename from spec/fixtures/packages/theme-without-package-file/styles/a.css rename to spec-nylas/fixtures/packages/theme-without-package-file/styles/a.css diff --git a/spec/fixtures/packages/theme-without-package-file/styles/b.css b/spec-nylas/fixtures/packages/theme-without-package-file/styles/b.css old mode 100644 new mode 100755 similarity index 100% rename from spec/fixtures/packages/theme-without-package-file/styles/b.css rename to spec-nylas/fixtures/packages/theme-without-package-file/styles/b.css diff --git a/spec/fixtures/packages/theme-without-package-file/styles/c.less b/spec-nylas/fixtures/packages/theme-without-package-file/styles/c.less old mode 100644 new mode 100755 similarity index 100% rename from spec/fixtures/packages/theme-without-package-file/styles/c.less rename to spec-nylas/fixtures/packages/theme-without-package-file/styles/c.less diff --git a/spec/fixtures/packages/theme-without-package-file/styles/d.csv b/spec-nylas/fixtures/packages/theme-without-package-file/styles/d.csv old mode 100644 new mode 100755 similarity index 100% rename from spec/fixtures/packages/theme-without-package-file/styles/d.csv rename to spec-nylas/fixtures/packages/theme-without-package-file/styles/d.csv diff --git a/spec-nylas/fixtures/sample.less b/spec-nylas/fixtures/sample.less new file mode 100644 index 000000000..a076a9d01 --- /dev/null +++ b/spec-nylas/fixtures/sample.less @@ -0,0 +1,8 @@ +@color: #4D926F; + +#header { + color: @color; +} +h2 { + color: @color; +} \ No newline at end of file diff --git a/spec/fixtures/task-spec-handler.coffee b/spec-nylas/fixtures/task-spec-handler.coffee similarity index 100% rename from spec/fixtures/task-spec-handler.coffee rename to spec-nylas/fixtures/task-spec-handler.coffee diff --git a/spec/menu-manager-spec.coffee b/spec-nylas/menu-manager-spec.coffee similarity index 100% rename from spec/menu-manager-spec.coffee rename to spec-nylas/menu-manager-spec.coffee diff --git a/spec/module-cache-spec.coffee b/spec-nylas/module-cache-spec.coffee similarity index 92% rename from spec/module-cache-spec.coffee rename to spec-nylas/module-cache-spec.coffee index b16a256c6..7b29849f9 100644 --- a/spec/module-cache-spec.coffee +++ b/spec-nylas/module-cache-spec.coffee @@ -23,7 +23,7 @@ describe 'ModuleCache', -> _atomModuleCache: extensions: '.json': [ - path.join('spec', 'fixtures', 'module-cache', 'file.json') + path.join('spec-nylas', 'fixtures', 'module-cache', 'file.json') ] } expect(require('./fixtures/module-cache/file.json').foo).toBe 'bar' @@ -46,7 +46,7 @@ describe 'ModuleCache', -> dependencies: [{ name: 'underscore' version: require('underscore/package.json').version - path: path.join('node_modules', 'underscore', 'lib', 'underscore.js') + path: path.join('node_modules', 'underscore', 'underscore.js') }] } @@ -77,7 +77,7 @@ describe 'ModuleCache', -> dependencies: [{ name: 'underscore' version: require('underscore/package.json').version - path: path.join('node_modules', 'underscore', 'lib', 'underscore.js') + path: path.join('node_modules', 'underscore', 'underscore.js') }] } diff --git a/spec/atom-protocol-handler-spec.coffee b/spec-nylas/nylas-protocol-handler-spec.coffee similarity index 85% rename from spec/atom-protocol-handler-spec.coffee rename to spec-nylas/nylas-protocol-handler-spec.coffee index d1a502910..416831de5 100644 --- a/spec/atom-protocol-handler-spec.coffee +++ b/spec-nylas/nylas-protocol-handler-spec.coffee @@ -1,11 +1,11 @@ {$} = require '../src/space-pen-extensions' -describe '"atom" protocol URL', -> +describe '"nylas" protocol URL', -> it 'sends the file relative in the package as response', -> called = false callback = -> called = true $.ajax - url: 'atom://async/package.json' + url: 'nylas://async/package.json' success: callback # In old versions of jQuery, ajax calls to custom protocol would always # be treated as error eventhough the browser thinks it's a success diff --git a/spec/package-manager-spec.coffee b/spec-nylas/package-manager-spec.coffee similarity index 87% rename from spec/package-manager-spec.coffee rename to spec-nylas/package-manager-spec.coffee index 4d949b594..414152555 100644 --- a/spec/package-manager-spec.coffee +++ b/spec-nylas/package-manager-spec.coffee @@ -6,7 +6,8 @@ describe "PackageManager", -> workspaceElement = null beforeEach -> - workspaceElement = atom.views.getView(atom.workspace) + workspaceElement = document.createElement('atom-workspace') + jasmine.attachToDOM(workspaceElement) describe "::loadPackage(name)", -> beforeEach -> @@ -32,7 +33,7 @@ describe "PackageManager", -> it "returns null if the package has an invalid package.json", -> spyOn(console, 'warn') expect(atom.packages.loadPackage("package-with-broken-package-json")).toBeNull() - expect(console.warn.callCount).toBe(1) + expect(console.warn.callCount).toBe(2) expect(console.warn.argsForCall[0][0]).toContain("Failed to load package.json") it "returns null if the package is not found in any package directory", -> @@ -154,64 +155,6 @@ describe "PackageManager", -> expect(atom.config.get('package-with-config-defaults.numbers.one')).toBe 1 expect(atom.config.get('package-with-config-defaults.numbers.two')).toBe 2 - describe "when the package metadata includes `activationCommands`", -> - [mainModule, promise, workspaceCommandListener] = [] - - beforeEach -> - jasmine.attachToDOM(workspaceElement) - mainModule = require './fixtures/packages/package-with-activation-commands/index' - mainModule.legacyActivationCommandCallCount = 0 - mainModule.activationCommandCallCount = 0 - spyOn(mainModule, 'activate').andCallThrough() - spyOn(Package.prototype, 'requireMainModule').andCallThrough() - - workspaceCommandListener = jasmine.createSpy('workspaceCommandListener') - atom.commands.add '.workspace', 'activation-command', workspaceCommandListener - - promise = atom.packages.activatePackage('package-with-activation-commands') - - it "defers requiring/activating the main module until an activation event bubbles to the root view", -> - expect(promise.isFulfilled()).not.toBeTruthy() - workspaceElement.dispatchEvent(new CustomEvent('activation-command', bubbles: true)) - - waitsForPromise -> - promise - - it "triggers the activation event on all handlers registered during activation", -> - waitsForPromise -> - atom.workspace.open() - - runs -> - editorView = atom.views.getView(atom.workspace.getActiveTextEditor()).__spacePenView - legacyCommandListener = jasmine.createSpy("legacyCommandListener") - editorView.command 'activation-command', legacyCommandListener - editorCommandListener = jasmine.createSpy("editorCommandListener") - atom.commands.add 'atom-text-editor', 'activation-command', editorCommandListener - atom.commands.dispatch(editorView[0], 'activation-command') - expect(mainModule.activate.callCount).toBe 1 - expect(mainModule.legacyActivationCommandCallCount).toBe 1 - expect(mainModule.activationCommandCallCount).toBe 1 - expect(legacyCommandListener.callCount).toBe 1 - expect(editorCommandListener.callCount).toBe 1 - expect(workspaceCommandListener.callCount).toBe 1 - atom.commands.dispatch(editorView[0], 'activation-command') - expect(mainModule.legacyActivationCommandCallCount).toBe 2 - expect(mainModule.activationCommandCallCount).toBe 2 - expect(legacyCommandListener.callCount).toBe 2 - expect(editorCommandListener.callCount).toBe 2 - expect(workspaceCommandListener.callCount).toBe 2 - expect(mainModule.activate.callCount).toBe 1 - - it "activates the package immediately when the events are empty", -> - mainModule = require './fixtures/packages/package-with-empty-activation-commands/index' - spyOn(mainModule, 'activate').andCallThrough() - - waitsForPromise -> - atom.packages.activatePackage('package-with-empty-activation-commands') - - runs -> - expect(mainModule.activate.callCount).toBe 1 - describe "when the package has no main module", -> it "does not throw an exception", -> spyOn(console, "error") @@ -233,7 +176,7 @@ describe "PackageManager", -> waitsForPromise -> atom.packages.activatePackage("package-with-serialization") runs -> - expect(pack.mainModule.activate).toHaveBeenCalledWith({someNumber: 77}) + expect(pack.mainModule.activate.calls[0].args[0]).toEqual({someNumber: 77}) it "invokes ::onDidActivatePackage listeners with the activated package", -> activatedPackage = null @@ -424,15 +367,6 @@ describe "PackageManager", -> expect(count).toBe 4 - describe "grammar loading", -> - it "loads the package's grammars", -> - waitsForPromise -> - atom.packages.activatePackage('package-with-grammars') - - runs -> - expect(atom.grammars.selectGrammar('a.alot').name).toBe 'Alot' - expect(atom.grammars.selectGrammar('a.alittle').name).toBe 'Alittle' - describe "scoped-property loading", -> it "loads the scoped properties", -> waitsForPromise -> @@ -550,15 +484,6 @@ describe "PackageManager", -> expect(-> atom.packages.deactivatePackage("package-that-throws-on-deactivate")).not.toThrow() expect(console.error).toHaveBeenCalled() - it "removes the package's grammars", -> - waitsForPromise -> - atom.packages.activatePackage('package-with-grammars') - - runs -> - atom.packages.deactivatePackage('package-with-grammars') - expect(atom.grammars.selectGrammar('a.alot').name).toBe 'Null Grammar' - expect(atom.grammars.selectGrammar('a.alittle').name).toBe 'Null Grammar' - it "removes the package's keymaps", -> waitsForPromise -> atom.packages.activatePackage('package-with-keymaps') diff --git a/spec/package-spec.coffee b/spec-nylas/package-spec.coffee similarity index 83% rename from spec/package-spec.coffee rename to spec-nylas/package-spec.coffee index 87d243ce2..cd76dc645 100644 --- a/spec/package-spec.coffee +++ b/spec-nylas/package-spec.coffee @@ -3,20 +3,23 @@ path = require 'path' Package = require '../src/package' ThemePackage = require '../src/theme-package' +resolveFixturePath = (packagename) -> + path.join(__dirname, 'fixtures', 'packages', packagename) + describe "Package", -> describe "when the package contains incompatible native modules", -> beforeEach -> spyOn(atom, 'inDevMode').andReturn(false) it "does not activate it", -> - packagePath = atom.project.getDirectories()[0]?.resolve('packages/package-with-incompatible-native-module') + packagePath = resolveFixturePath('package-with-incompatible-native-module') pack = new Package(packagePath) expect(pack.isCompatible()).toBe false expect(pack.incompatibleModules[0].name).toBe 'native-module' expect(pack.incompatibleModules[0].path).toBe path.join(packagePath, 'node_modules', 'native-module') it "caches the incompatible native modules in local storage", -> - packagePath = atom.project.getDirectories()[0]?.resolve('packages/package-with-incompatible-native-module') + packagePath = resolveFixturePath('package-with-incompatible-native-module') cacheKey = null cacheItem = null @@ -46,14 +49,14 @@ describe "Package", -> describe "when the theme contains a single style file", -> it "loads and applies css", -> expect($("atom-text-editor").css("padding-bottom")).not.toBe "1234px" - themePath = atom.project.getDirectories()[0]?.resolve('packages/theme-with-index-css') + themePath = resolveFixturePath('theme-with-index-css') theme = new ThemePackage(themePath) theme.activate() expect($("atom-text-editor").css("padding-top")).toBe "1234px" it "parses, loads and applies less", -> expect($("atom-text-editor").css("padding-bottom")).not.toBe "1234px" - themePath = atom.project.getDirectories()[0]?.resolve('packages/theme-with-index-less') + themePath = resolveFixturePath('theme-with-index-less') theme = new ThemePackage(themePath) theme.activate() expect($("atom-text-editor").css("padding-top")).toBe "4321px" @@ -64,7 +67,7 @@ describe "Package", -> expect($("atom-text-editor").css("padding-right")).not.toBe("102px") expect($("atom-text-editor").css("padding-bottom")).not.toBe("103px") - themePath = atom.project.getDirectories()[0]?.resolve('packages/theme-with-package-file') + themePath = resolveFixturePath('theme-with-package-file') theme = new ThemePackage(themePath) theme.activate() expect($("atom-text-editor").css("padding-top")).toBe("101px") @@ -77,7 +80,7 @@ describe "Package", -> expect($("atom-text-editor").css("padding-right")).not.toBe "20px" expect($("atom-text-editor").css("padding-bottom")).not.toBe "30px" - themePath = atom.project.getDirectories()[0]?.resolve('packages/theme-without-package-file') + themePath = resolveFixturePath('theme-without-package-file') theme = new ThemePackage(themePath) theme.activate() expect($("atom-text-editor").css("padding-top")).toBe "10px" @@ -86,7 +89,7 @@ describe "Package", -> describe "reloading a theme", -> beforeEach -> - themePath = atom.project.getDirectories()[0]?.resolve('packages/theme-with-package-file') + themePath = resolveFixturePath('theme-with-package-file') theme = new ThemePackage(themePath) theme.activate() @@ -97,7 +100,7 @@ describe "Package", -> describe "events", -> beforeEach -> - themePath = atom.project.getDirectories()[0]?.resolve('packages/theme-with-package-file') + themePath = resolveFixturePath('theme-with-package-file') theme = new ThemePackage(themePath) theme.activate() diff --git a/spec/style-manager-spec.coffee b/spec-nylas/style-manager-spec.coffee similarity index 100% rename from spec/style-manager-spec.coffee rename to spec-nylas/style-manager-spec.coffee diff --git a/spec/styles-element-spec.coffee b/spec-nylas/styles-element-spec.coffee similarity index 100% rename from spec/styles-element-spec.coffee rename to spec-nylas/styles-element-spec.coffee diff --git a/spec/task-spec.coffee b/spec-nylas/task-spec.coffee similarity index 100% rename from spec/task-spec.coffee rename to spec-nylas/task-spec.coffee diff --git a/spec/theme-manager-spec.coffee b/spec-nylas/theme-manager-spec.coffee similarity index 72% rename from spec/theme-manager-spec.coffee rename to spec-nylas/theme-manager-spec.coffee index 94e5fad61..aa2668ced 100644 --- a/spec/theme-manager-spec.coffee +++ b/spec-nylas/theme-manager-spec.coffee @@ -43,7 +43,7 @@ describe "ThemeManager", -> describe "when the core.themes config value contains invalid entry", -> it "ignores theme", -> atom.config.set 'core.themes', [ - 'atom-light-ui' + 'ui-light' null undefined '' @@ -51,21 +51,21 @@ describe "ThemeManager", -> 4 {} [] - 'atom-dark-ui' + 'ui-dark' ] - expect(themeManager.getEnabledThemeNames()).toEqual ['atom-dark-ui', 'atom-light-ui'] + expect(themeManager.getEnabledThemeNames()).toEqual ['ui-dark', 'ui-light'] describe "::getImportPaths()", -> it "returns the theme directories before the themes are loaded", -> - atom.config.set('core.themes', ['theme-with-index-less', 'atom-dark-ui', 'atom-light-ui']) + atom.config.set('core.themes', ['theme-with-index-less', 'ui-dark', 'ui-light']) paths = themeManager.getImportPaths() # syntax theme is not a dir at this time, so only two. expect(paths.length).toBe 2 - expect(paths[0]).toContain 'atom-light-ui' - expect(paths[1]).toContain 'atom-dark-ui' + expect(paths[0]).toContain 'ui-light' + expect(paths[1]).toContain 'ui-dark' it "ignores themes that cannot be resolved to a directory", -> atom.config.set('core.themes', ['definitely-not-a-theme']) @@ -89,7 +89,16 @@ describe "ThemeManager", -> runs -> didChangeActiveThemesHandler.reset() expect($('style.theme')).toHaveLength 0 - atom.config.set('core.themes', ['atom-dark-ui']) + atom.config.set('core.themes', ['ui-dark']) + + waitsFor -> + didChangeActiveThemesHandler.callCount == 1 + + runs -> + didChangeActiveThemesHandler.reset() + expect($('style[priority=1]')).toHaveLength 1 + expect($('style[priority=1]:eq(0)').attr('source-path')).toMatch /ui-dark/ + atom.config.set('core.themes', ['ui-light', 'ui-dark']) waitsFor -> didChangeActiveThemesHandler.callCount == 1 @@ -97,17 +106,8 @@ describe "ThemeManager", -> runs -> didChangeActiveThemesHandler.reset() expect($('style[priority=1]')).toHaveLength 2 - expect($('style[priority=1]:eq(0)').attr('source-path')).toMatch /atom-dark-ui/ - atom.config.set('core.themes', ['atom-light-ui', 'atom-dark-ui']) - - waitsFor -> - didChangeActiveThemesHandler.callCount == 1 - - runs -> - didChangeActiveThemesHandler.reset() - expect($('style[priority=1]')).toHaveLength 2 - expect($('style[priority=1]:eq(0)').attr('source-path')).toMatch /atom-dark-ui/ - expect($('style[priority=1]:eq(1)').attr('source-path')).toMatch /atom-light-ui/ + expect($('style[priority=1]:eq(0)').attr('source-path')).toMatch /ui-dark/ + expect($('style[priority=1]:eq(1)').attr('source-path')).toMatch /ui-light/ atom.config.set('core.themes', []) waitsFor -> @@ -115,9 +115,9 @@ describe "ThemeManager", -> runs -> didChangeActiveThemesHandler.reset() - expect($('style[priority=1]')).toHaveLength 2 - # atom-dark-ui has an directory path, the syntax one doesn't - atom.config.set('core.themes', ['theme-with-index-less', 'atom-dark-ui']) + expect($('style[priority=1]')).toHaveLength(1) + # ui-dark has an directory path, the syntax one doesn't + atom.config.set('core.themes', ['theme-with-index-less', 'ui-light']) waitsFor -> didChangeActiveThemesHandler.callCount == 1 @@ -126,20 +126,22 @@ describe "ThemeManager", -> expect($('style[priority=1]')).toHaveLength 2 importPaths = themeManager.getImportPaths() expect(importPaths.length).toBe 1 - expect(importPaths[0]).toContain 'atom-dark-ui' + expect(importPaths[0]).toContain 'ui-light' it 'adds theme-* classes to the workspace for each active theme', -> - workspaceElement = atom.views.getView(atom.workspace) + workspaceElement = document.createElement('atom-workspace') + jasmine.attachToDOM(workspaceElement) + themeManager.onDidChangeActiveThemes didChangeActiveThemesHandler = jasmine.createSpy() waitsForPromise -> themeManager.activateThemes() runs -> - expect(workspaceElement).toHaveClass 'theme-atom-dark-ui' + expect(workspaceElement).toHaveClass 'theme-ui-light' themeManager.onDidChangeActiveThemes didChangeActiveThemesHandler = jasmine.createSpy() - atom.config.set('core.themes', ['theme-with-ui-variables', 'theme-with-syntax-variables']) + atom.config.set('core.themes', ['theme-with-ui-variables']) waitsFor -> didChangeActiveThemesHandler.callCount > 0 @@ -147,9 +149,7 @@ describe "ThemeManager", -> runs -> # `theme-` twice as it prefixes the name with `theme-` expect(workspaceElement).toHaveClass 'theme-theme-with-ui-variables' - expect(workspaceElement).toHaveClass 'theme-theme-with-syntax-variables' - expect(workspaceElement).not.toHaveClass 'theme-atom-dark-ui' - expect(workspaceElement).not.toHaveClass 'theme-atom-dark-syntax' + expect(workspaceElement).not.toHaveClass 'theme-ui-dark' describe "when a theme fails to load", -> it "logs a warning", -> @@ -170,7 +170,7 @@ describe "ThemeManager", -> themeManager.onDidChangeStylesheets stylesheetsChangedHandler = jasmine.createSpy("stylesheetsChangedHandler") themeManager.onDidAddStylesheet stylesheetAddedHandler = jasmine.createSpy("stylesheetAddedHandler") - cssPath = atom.project.getDirectories()[0]?.resolve('css.css') + cssPath = path.join(__dirname, 'fixtures', 'css.css') lengthBefore = $('head style').length themeManager.requireStylesheet(cssPath) @@ -194,7 +194,7 @@ describe "ThemeManager", -> $('head style[id*="css.css"]').remove() it "synchronously loads and parses less files at the given path and installs a style tag for it in the head", -> - lessPath = atom.project.getDirectories()[0]?.resolve('sample.less') + lessPath = path.join(__dirname, 'fixtures', 'sample.less') lengthBefore = $('head style').length themeManager.requireStylesheet(lessPath) expect($('head style').length).toBe lengthBefore + 1 @@ -218,9 +218,9 @@ describe "ThemeManager", -> it "supports requiring css and less stylesheets without an explicit extension", -> themeManager.requireStylesheet path.join(__dirname, 'fixtures', 'css') - expect($('head style[source-path*="css.css"]').attr('source-path')).toBe themeManager.stringToId(atom.project.getDirectories()[0]?.resolve('css.css')) + expect($('head style[source-path*="css.css"]').attr('source-path')).toBe themeManager.stringToId(path.join(__dirname, 'fixtures', 'css.css')) themeManager.requireStylesheet path.join(__dirname, 'fixtures', 'sample') - expect($('head style[source-path*="sample.less"]').attr('source-path')).toBe themeManager.stringToId(atom.project.getDirectories()[0]?.resolve('sample.less')) + expect($('head style[source-path*="sample.less"]').attr('source-path')).toBe themeManager.stringToId(path.join(__dirname, 'fixtures', 'sample.less')) $('head style[id*="css.css"]').remove() $('head style[id*="sample.less"]').remove() @@ -251,48 +251,54 @@ describe "ThemeManager", -> describe "base style sheet loading", -> workspaceElement = null beforeEach -> - workspaceElement = atom.views.getView(atom.workspace) - jasmine.attachToDOM(workspaceElement) + workspaceElement = document.createElement('atom-workspace') workspaceElement.appendChild document.createElement('atom-text-editor') + jasmine.attachToDOM(workspaceElement) waitsForPromise -> themeManager.activateThemes() - it "loads the correct values from the theme's ui-variables file", -> - themeManager.onDidChangeActiveThemes didChangeActiveThemesHandler = jasmine.createSpy() - atom.config.set('core.themes', ['theme-with-ui-variables', 'theme-with-syntax-variables']) - - waitsFor -> - didChangeActiveThemesHandler.callCount > 0 - runs -> - # an override loaded in the base css + themeManager.onDidChangeActiveThemes didChangeActiveThemesHandler = jasmine.createSpy() + additionalDelay = null + @waitsForThemeRefresh = -> + waitsFor -> + # We need to wait a bit of additional time for the browser to actually + # apply the CSS to the elements we check. + if didChangeActiveThemesHandler.callCount > 0 + additionalDelay ?= Date.now() + 100 + return Date.now() > additionalDelay + return false + + it "loads the correct values from the theme's ui-variables file", -> + atom.config.set('core.themes', ['theme-with-ui-variables']) + + @waitsForThemeRefresh() + runs -> + # an override loaded in the base css of theme-with-ui-variables expect(getComputedStyle(workspaceElement)["background-color"]).toBe "rgb(0, 0, 255)" - # from within the theme itself + # a value that is not overridden in the theme expect($("atom-text-editor").css("padding-top")).toBe "150px" expect($("atom-text-editor").css("padding-right")).toBe "150px" expect($("atom-text-editor").css("padding-bottom")).toBe "150px" describe "when there is a theme with incomplete variables", -> it "loads the correct values from the fallback ui-variables", -> - themeManager.onDidChangeActiveThemes didChangeActiveThemesHandler = jasmine.createSpy() - atom.config.set('core.themes', ['theme-with-incomplete-ui-variables', 'theme-with-syntax-variables']) - - waitsFor -> - didChangeActiveThemesHandler.callCount > 0 + atom.config.set('core.themes', ['theme-with-incomplete-ui-variables']) + @waitsForThemeRefresh() runs -> - # an override loaded in the base css + # an override loaded in the base css of theme-with-incomplete-ui-variables expect(getComputedStyle(workspaceElement)["background-color"]).toBe "rgb(0, 0, 255)" - # from within the theme itself - expect($("atom-text-editor").css("background-color")).toBe "rgb(0, 152, 255)" + # a value that is not overridden in the theme + expect($("atom-text-editor").css("background-color")).toBe "rgb(152, 123, 0)" describe "user stylesheet", -> userStylesheetPath = null beforeEach -> - userStylesheetPath = path.join(temp.mkdirSync("atom"), 'styles.less') + userStylesheetPath = path.join(temp.mkdirSync("nylas-spec"), 'styles.less') fs.writeFileSync(userStylesheetPath, 'body {border-style: dotted !important;}') spyOn(atom.styles, 'getUserStyleSheetPath').andReturn userStylesheetPath @@ -331,12 +337,19 @@ describe "ThemeManager", -> expect(styleElementRemovedHandler).toHaveBeenCalled() expect(styleElementRemovedHandler.argsForCall[0][0].textContent).toContain 'dotted' expect(stylesheetRemovedHandler).toHaveBeenCalled() - expect(stylesheetRemovedHandler.argsForCall[0][0].cssRules[0].style.border).toBe 'dotted' + + match = null + for rule in stylesheetRemovedHandler.argsForCall[0][0].cssRules + match = rule if rule.selectorText is 'body' + expect(match.style.border).toBe 'dotted' expect(styleElementAddedHandler).toHaveBeenCalled() expect(styleElementAddedHandler.argsForCall[0][0].textContent).toContain 'dashed' expect(stylesheetAddedHandler).toHaveBeenCalled() - expect(stylesheetAddedHandler.argsForCall[0][0].cssRules[0].style.border).toBe 'dashed' + match = null + for rule in stylesheetAddedHandler.argsForCall[0][0].cssRules + match = rule if rule.selectorText is 'body' + expect(match.style.border).toBe 'dashed' expect(stylesheetsChangedHandler).toHaveBeenCalled() @@ -352,8 +365,14 @@ describe "ThemeManager", -> expect(styleElementRemovedHandler).toHaveBeenCalled() expect(styleElementRemovedHandler.argsForCall[0][0].textContent).toContain 'dashed' expect(stylesheetRemovedHandler).toHaveBeenCalled() - expect(stylesheetRemovedHandler.argsForCall[0][0].cssRules[0].style.border).toBe 'dashed' - expect($(document.body).css('border-style')).toBe 'none' + + waitsFor -> + match = null + for rule in stylesheetRemovedHandler.argsForCall[0][0].cssRules + match = rule if rule.selectorText is 'body' + match.style.border is 'dashed' and $(document.body).css('border-style') is 'none' + + runs -> expect(stylesheetsChangedHandler).toHaveBeenCalled() describe "when there is an error reading the stylesheet", -> @@ -362,100 +381,80 @@ describe "ThemeManager", -> themeManager.loadUserStylesheet() spyOn(themeManager.lessCache, 'cssForFile').andCallFake -> throw new Error('EACCES permission denied "styles.less"') - atom.notifications.onDidAddNotification addErrorHandler = jasmine.createSpy() + spyOn(console, 'error').andCallThrough() it "creates an error notification and does not add the stylesheet", -> themeManager.loadUserStylesheet() - expect(addErrorHandler).toHaveBeenCalled() - note = addErrorHandler.mostRecentCall.args[0] - expect(note.getType()).toBe 'error' - expect(note.getMessage()).toContain 'Error loading' + expect(console.error).toHaveBeenCalled() + note = console.error.mostRecentCall.args[0] + expect(note).toEqual 'EACCES permission denied "styles.less"' expect(atom.styles.styleElementsBySourcePath[atom.styles.getUserStyleSheetPath()]).toBeUndefined() describe "when there is an error watching the user stylesheet", -> addErrorHandler = null beforeEach -> {File} = require 'pathwatcher' - spyOn(File::, 'on').andCallFake (event) -> - if event.indexOf('contents-changed') > -1 - throw new Error('Unable to watch path') + spyOn(File::, 'onDidChange').andCallFake (event) -> + throw new Error('Unable to watch path') spyOn(themeManager, 'loadStylesheet').andReturn '' - atom.notifications.onDidAddNotification addErrorHandler = jasmine.createSpy() + spyOn(console, 'error').andCallThrough() it "creates an error notification", -> themeManager.loadUserStylesheet() - expect(addErrorHandler).toHaveBeenCalled() - note = addErrorHandler.mostRecentCall.args[0] - expect(note.getType()).toBe 'error' - expect(note.getMessage()).toContain 'Unable to watch path' + expect(console.error).toHaveBeenCalled() + note = console.error.mostRecentCall.args[0] + expect(note).toEqual 'Error: Unable to watch path' describe "when a non-existent theme is present in the config", -> beforeEach -> spyOn(console, 'warn') - atom.config.set('core.themes', ['non-existent-dark-ui', 'non-existent-dark-syntax']) + atom.config.set('core.themes', ['non-existent-dark-ui']) waitsForPromise -> themeManager.activateThemes() - it 'uses the default dark UI and syntax themes and logs a warning', -> + it 'uses the default theme and logs a warning', -> activeThemeNames = themeManager.getActiveThemeNames() - expect(console.warn.callCount).toBe 2 - expect(activeThemeNames.length).toBe(2) - expect(activeThemeNames).toContain('atom-dark-ui') - expect(activeThemeNames).toContain('atom-dark-syntax') + expect(console.warn.callCount).toBe(1) + expect(activeThemeNames.length).toBe(1) + expect(activeThemeNames).toContain('ui-light') describe "when in safe mode", -> beforeEach -> themeManager = new ThemeManager({packageManager: atom.packages, resourcePath, configDirPath, safeMode: true}) - describe 'when the enabled UI and syntax themes are bundled with Atom', -> + describe 'when the enabled UI theme is bundled with Nylas Mail', -> beforeEach -> - atom.config.set('core.themes', ['atom-light-ui', 'atom-dark-syntax']) + atom.config.set('core.themes', ['ui-light']) waitsForPromise -> themeManager.activateThemes() it 'uses the enabled themes', -> activeThemeNames = themeManager.getActiveThemeNames() - expect(activeThemeNames.length).toBe(2) - expect(activeThemeNames).toContain('atom-light-ui') - expect(activeThemeNames).toContain('atom-dark-syntax') + expect(activeThemeNames.length).toBe(1) + expect(activeThemeNames).toContain('ui-light') - describe 'when the enabled UI and syntax themes are not bundled with Atom', -> + describe 'when the enabled UI theme is not bundled with Nylas Mail', -> beforeEach -> - atom.config.set('core.themes', ['installed-dark-ui', 'installed-dark-syntax']) + atom.config.set('core.themes', ['installed-dark-ui']) waitsForPromise -> themeManager.activateThemes() - it 'uses the default dark UI and syntax themes', -> + it 'uses the default UI theme', -> activeThemeNames = themeManager.getActiveThemeNames() - expect(activeThemeNames.length).toBe(2) - expect(activeThemeNames).toContain('atom-dark-ui') - expect(activeThemeNames).toContain('atom-dark-syntax') + expect(activeThemeNames.length).toBe(1) + expect(activeThemeNames).toContain('ui-light') - describe 'when the enabled UI theme is not bundled with Atom', -> + describe 'when the enabled UI theme is not bundled with Nylas Mail', -> beforeEach -> - atom.config.set('core.themes', ['installed-dark-ui', 'atom-light-syntax']) + atom.config.set('core.themes', ['installed-dark-ui']) waitsForPromise -> themeManager.activateThemes() - it 'uses the default dark UI theme', -> + it 'uses the default UI theme', -> activeThemeNames = themeManager.getActiveThemeNames() - expect(activeThemeNames.length).toBe(2) - expect(activeThemeNames).toContain('atom-dark-ui') - expect(activeThemeNames).toContain('atom-light-syntax') - - describe 'when the enabled syntax theme is not bundled with Atom', -> - beforeEach -> - atom.config.set('core.themes', ['atom-light-ui', 'installed-dark-syntax']) - - waitsForPromise -> - themeManager.activateThemes() - - it 'uses the default dark syntax theme', -> - activeThemeNames = themeManager.getActiveThemeNames() - expect(activeThemeNames.length).toBe(2) - expect(activeThemeNames).toContain('atom-light-ui') - expect(activeThemeNames).toContain('atom-dark-syntax') + expect(activeThemeNames.length).toBe(1) + expect(activeThemeNames).toContain('ui-light') diff --git a/spec/fixtures/packages/package-with-incompatible-native-module/node_modules/native-module/main.js b/spec/fixtures/packages/package-with-incompatible-native-module/node_modules/native-module/main.js deleted file mode 100644 index 97f5c264e..000000000 --- a/spec/fixtures/packages/package-with-incompatible-native-module/node_modules/native-module/main.js +++ /dev/null @@ -1 +0,0 @@ -throw new Error("this simulates a native module's failure to load") diff --git a/spec/fixtures/packages/package-with-incompatible-native-module/node_modules/native-module/package.json b/spec/fixtures/packages/package-with-incompatible-native-module/node_modules/native-module/package.json deleted file mode 100644 index cac262cba..000000000 --- a/spec/fixtures/packages/package-with-incompatible-native-module/node_modules/native-module/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "native-module", - "main": "./main.js" -} diff --git a/spec/spec-helper.coffee b/spec/spec-helper.coffee index b8b6fa011..6b4139551 100644 --- a/spec/spec-helper.coffee +++ b/spec/spec-helper.coffee @@ -27,7 +27,7 @@ atom.themes.loadBaseStylesheets() atom.themes.requireStylesheet '../static/jasmine' atom.themes.initialLoadComplete = true -fixturePackagesPath = path.resolve(__dirname, './fixtures/packages') +fixturePackagesPath = path.resolve(__dirname, '../spec-nylas/fixtures/packages') atom.packages.packageDirPaths.unshift(fixturePackagesPath) atom.keymaps.loadBundledKeymaps() keyBindingsToRestore = atom.keymaps.getKeyBindings() @@ -101,6 +101,7 @@ ReactTestUtils.unmountAll = -> beforeEach -> Grim.clearDeprecations() if isCoreSpec ComponentRegistry._clear() + global.localStorage.clear() TaskQueue._queue = [] TaskQueue._completed = [] @@ -325,8 +326,11 @@ window.waitsForPromise = (args...) -> window.waitsFor timeout, (moveOn) -> promise = fn() - if not (promise instanceof Promise) - jasmine.getEnv().currentSpec.fail("Expected callback to return a promise, but it returned #{promise}") + # Keep in mind we can't check `promise instanceof Promise` because parts of + # the app still use other Promise libraries (Atom used Q, we use Bluebird.) + # Just see if it looks promise-like. + if not promise or not promise.then + jasmine.getEnv().currentSpec.fail("Expected callback to return a promise-like object, but it returned #{promise}") moveOn() else if shouldReject promise.catch(moveOn) diff --git a/src/config-schema.coffee b/src/config-schema.coffee index d0594de29..078135925 100644 --- a/src/config-schema.coffee +++ b/src/config-schema.coffee @@ -14,7 +14,7 @@ module.exports = type: 'string' themes: type: 'array' - default: ['light-ui'] + default: ['ui-light'] items: type: 'string' diff --git a/src/config.coffee b/src/config.coffee index 81f5b8ba5..cdd8b0651 100644 --- a/src/config.coffee +++ b/src/config.coffee @@ -544,7 +544,7 @@ class Config # You might want to change the themes programmatically: # # ```coffee - # atom.config.set('core.themes', ['atom-light-ui', 'atom-light-syntax']) + # atom.config.set('core.themes', ['ui-light', 'atom-light-syntax']) # ``` # # You can also set scoped settings. For example, you might want change the diff --git a/src/theme-manager.coffee b/src/theme-manager.coffee index 7208535ad..541485e23 100644 --- a/src/theme-manager.coffee +++ b/src/theme-manager.coffee @@ -2,7 +2,7 @@ path = require 'path' _ = require 'underscore' EmitterMixin = require('emissary').Emitter -{Emitter, Disposable} = require 'event-kit' +{Emitter, Disposable, CompositeDisposable} = require 'event-kit' {File} = require 'pathwatcher' fs = require 'fs-plus' Q = require 'q' @@ -196,15 +196,15 @@ class ThemeManager console.warn("Enabled theme '#{themeName}' is not installed.") false - # Use a built-in syntax and UI theme any time the configured themes are not + # Use a built-in theme any time the configured themes are not # available. if themeNames.length is 0 builtInThemeNames = [ - 'light-ui' + 'ui-light', 'ui-dark' ] themeNames = _.intersection(themeNames, builtInThemeNames) if themeNames.length is 0 - themeNames = ['light-ui'] + themeNames = ['ui-light'] # Reverse so the first (top) theme is loaded after the others. We want # the first/top theme to override later themes in the stack. @@ -254,7 +254,6 @@ class ThemeManager userStylesheetPath = atom.styles.getUserStyleSheetPath() return unless fs.isFileSync(userStylesheetPath) - try @userStylesheetFile = new File(userStylesheetPath) @userStylsheetSubscriptions = new CompositeDisposable() @@ -272,6 +271,7 @@ class ThemeManager [watches]:https://github.com/atom/atom/blob/master/docs/build-instructions/linux.md#typeerror-unable-to-watch-path """ console.error(message, dismissable: true) + console.error(error.toString()) try userStylesheetContents = @loadStylesheet(userStylesheetPath, true) diff --git a/static/variables/ui-variables.less b/static/variables/ui-variables.less index 6913f64c3..59e0dd6c1 100644 --- a/static/variables/ui-variables.less +++ b/static/variables/ui-variables.less @@ -494,3 +494,6 @@ //== Panels and Sidebars @panel-background-color: @gray-lighter; @toolbar-background-color: @white; + +// Helpers for Specs - Do Not Remove +@spec-test-variable: rgb(152,123,0); diff --git a/static/workspace.less b/static/workspace.less index 9ff41bf60..05835bd09 100644 --- a/static/workspace.less +++ b/static/workspace.less @@ -19,6 +19,10 @@ atom-workspace { position: relative; font-family: @font-family; + /* Important: This attribute is used in the theme-manager-specs to check that + themes load and override each other correctly. Do not remove! */ + background-color: @background-primary; + atom-workspace-axis.horizontal { display: -webkit-flex; height: 100%;