diff --git a/.eslintrc.js b/.eslintrc.js index e070df0b..434405ad 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -48,15 +48,6 @@ module.exports = { rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, { // add your custom rules and overrides for node files here }) - }, - - // test files - { - files: ['tests/**/*.js'], - excludedFiles: ['tests/dummy/**/*.js'], - env: { - embertest: true - } } ] }; diff --git a/.travis.yml b/.travis.yml index bfa39e32..159e77e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,8 +23,8 @@ env: matrix: # we recommend new addons test the current and previous LTS # as well as latest stable release (bonus points to beta/canary) - - EMBER_TRY_SCENARIO=ember-lts-2.12 - EMBER_TRY_SCENARIO=ember-lts-2.16 + - EMBER_TRY_SCENARIO=ember-lts-2.18 - EMBER_TRY_SCENARIO=ember-release - EMBER_TRY_SCENARIO=ember-beta - EMBER_TRY_SCENARIO=ember-canary diff --git a/README.md b/README.md index 1a12b476..7ed89ad3 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,8 @@ You can also learn more by watching this Global Ember Meetup talk: [![Introduction to ember-cp-validations](https://i.vimeocdn.com/video/545445254.png?mw=1920&mh=1080&q=70)](https://vimeo.com/146857699) -## Installation +Installation +------------------------------------------------------------------------------ ```shell ember install ember-cp-validations diff --git a/app/styles/app.scss b/app/styles/app.scss new file mode 100644 index 00000000..ea8bf0ca --- /dev/null +++ b/app/styles/app.scss @@ -0,0 +1,2 @@ + +@import "ember-bootstrap/bootstrap"; diff --git a/config/ember-try.js b/config/ember-try.js index 786fd7ea..7024760c 100644 --- a/config/ember-try.js +++ b/config/ember-try.js @@ -1,75 +1,63 @@ -module.exports = { - useYarn: true, - scenarios: [ - { - name: 'ember-lts-2.12', - npm: { - devDependencies: { - 'ember-source': '~2.12.0' - } - } - }, - { - name: 'ember-lts-2.16', - npm: { - devDependencies: { - 'ember-source': '~2.16.0' - } - } - }, - { - name: 'ember-release', - bower: { - dependencies: { - ember: 'components/ember#release' +'use strict'; + +const getChannelURL = require('ember-source-channel-url'); + +module.exports = function() { + return Promise.all([ + getChannelURL('release'), + getChannelURL('beta'), + getChannelURL('canary') + ]).then(urls => { + return { + useYarn: true, + scenarios: [ + { + name: 'ember-lts-2.16', + npm: { + devDependencies: { + 'ember-source': '~2.16.0' + } + } }, - resolutions: { - ember: 'release' - } - }, - npm: { - devDependencies: { - 'ember-source': null - } - } - }, - { - name: 'ember-beta', - bower: { - dependencies: { - ember: 'components/ember#beta' + { + name: 'ember-lts-2.18', + npm: { + devDependencies: { + 'ember-source': '~2.18.0' + } + } }, - resolutions: { - ember: 'beta' - } - }, - npm: { - devDependencies: { - 'ember-source': null - } - } - }, - { - name: 'ember-canary', - bower: { - dependencies: { - ember: 'components/ember#canary' + { + name: 'ember-release', + npm: { + devDependencies: { + 'ember-source': urls[0] + } + } }, - resolutions: { - ember: 'canary' - } - }, - npm: { - devDependencies: { - 'ember-source': null - } - } - }, - { - name: 'ember-default', - npm: { - devDependencies: {} - } - } - ] + { + name: 'ember-beta', + npm: { + devDependencies: { + 'ember-source': urls[1] + } + } + }, + { + name: 'ember-canary', + npm: { + devDependencies: { + 'ember-source': urls[2] + } + } + }, + { + name: 'ember-default', + npm: { + devDependencies: {} + } + } + ] + }; + }); }; diff --git a/ember-cli-build.js b/ember-cli-build.js index 5fbb3d2e..1f236e95 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -5,7 +5,13 @@ const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); module.exports = function(defaults) { let app = new EmberAddon(defaults, { snippetSearchPaths: ['addon', 'tests/dummy/app'], - snippetPaths: ['snippets', 'tests/dummy/snippets'] + snippetPaths: ['snippets', 'tests/dummy/snippets'], + + 'ember-bootstrap': { + bootstrapVersion: 3, + importBootstrapFont: true, + importBootstrapCSS: false + } }); /* diff --git a/package.json b/package.json index 3efae0c7..e094edaa 100644 --- a/package.json +++ b/package.json @@ -36,27 +36,29 @@ ], "license": "MIT", "devDependencies": { + "bootstrap-sass": "^3.3.7", "broccoli-asset-rev": "^2.4.6", - "ember-cli": "~2.18.2", + "ember-bootstrap": "^1.2.1", + "ember-cli": "~3.0.2", "ember-cli-app-version": "^2.0.0", "ember-cli-autoprefixer": "^0.7.0", "ember-cli-changelog": "0.3.4", "ember-cli-code-coverage": "0.4.1", "ember-cli-dependency-checker": "^2.0.0", "ember-cli-eslint": "^4.2.1", - "ember-cli-github-pages": "^0.1.2", + "ember-cli-github-pages": "^0.2.0", "ember-cli-htmlbars": "^2.0.3", "ember-cli-htmlbars-inline-precompile": "^1.0.0", "ember-cli-inject-live-reload": "^1.4.1", - "ember-cli-less": "1.5.4", "ember-cli-moment-shim": "^3.3.3", "ember-cli-qunit": "^4.1.1", "ember-cli-release": "1.0.0-beta.2", + "ember-cli-sass": "^7.1.7", "ember-cli-shims": "^1.2.0", "ember-cli-sri": "^2.1.1", "ember-cli-uglify": "^2.0.0", "ember-cli-yuidoc": "^0.8.8", - "ember-code-snippet": "^1.7.0", + "ember-code-snippet": "^2.0.1", "ember-data": "^2.18.0", "ember-disable-prototype-extensions": "^1.1.2", "ember-export-application-global": "^2.0.0", @@ -65,16 +67,19 @@ "ember-maybe-import-regenerator": "^0.1.6", "ember-qunit-nice-errors": "^1.2.0", "ember-resolver": "^4.3.0", - "ember-source": "~2.18.0", - "ember-truth-helpers": "1.3.0", + "ember-source": "~3.0.0", + "ember-source-channel-url": "^1.0.1", + "ember-test-selectors": "^0.3.8", + "ember-truth-helpers": "2.0.0", + "ember-try": "^0.2.23", "eslint": "^4.17.0", "eslint-config-prettier": "^2.9.0", "eslint-plugin-ember": "^5.0.0", "eslint-plugin-node": "^5.2.1", "eslint-plugin-prettier": "^2.6.0", - "jquery": "^2.2.4", "loader.js": "^4.2.3", "prettier": "^1.10.2", + "qunit-dom": "^0.5.0", "yuidoc-ember-theme": "^1.4.0" }, "keywords": [ diff --git a/tests/acceptance/dummy-index-test.js b/tests/acceptance/dummy-index-test.js index c601ea7e..10095a88 100644 --- a/tests/acceptance/dummy-index-test.js +++ b/tests/acceptance/dummy-index-test.js @@ -1,7 +1,7 @@ -import { run } from '@ember/runloop'; +import { click, fillIn, find, visit } from '@ember/test-helpers'; +import { setupApplicationTest } from 'ember-qunit'; import { module, test } from 'qunit'; -import startApp from '../helpers/start-app'; -let App; +import { dasherize } from '@ember/string'; const validInputValues = { username: 'offirgolan', @@ -13,102 +13,69 @@ const validInputValues = { dob: '1/1/1930' }; -module('Acceptance | Dummy | index', { - beforeEach() { - App = startApp(); - }, - afterEach() { - run(App, App.destroy); - } -}); +module('Acceptance | Dummy | index', function(hooks) { + setupApplicationTest(hooks); -test('Page Loads', function(assert) { - assert.expect(2); - visit('/'); - andThen(function() { - assert.equal( - find('a.navbar-brand') - .text() - .trim(), - 'CP Validations' - ); - assert.equal(find('.form .register h2').text(), 'Create an Account'); - }); -}); + test('Page Loads', async function(assert) { + assert.expect(2); + await visit('/'); -test('Helper tooltips', function(assert) { - assert.expect(2); - visit('/'); - andThen(function() { - assert.equal(find('.section .section-info').length, 3); - assert.equal( - find('.section .section-info:first') - .text() - .trim().length > 0, - true - ); + assert.dom('a.navbar-brand').hasText('CP Validations'); + assert.dom('.form .register h2').hasText('Create an Account'); }); -}); -test('Invalid form submit', function(assert) { - visit('/'); - andThen(function() { - click('#signup'); - }); + test('Helper tooltips', async function(assert) { + assert.expect(2); + await visit('/'); - andThen(function() { - assert.equal( - find('.form .alert') - .text() - .trim(), - 'Please fix all the errors below before continuing.' - ); + assert.dom('.section .section-info').exists({ count: 3 }); + assert + .dom(find('.section .section-info')) + .includesText('These form inputs are bound to the User model'); }); -}); -test('Valid form submit', function(assert) { - visit('/'); - andThen(function() { - Object.keys(validInputValues).forEach(input => { - let $input = find(`.validated-input input[name='${input}']`); - assert.ok($input, `${input} found`); - fillIn($input, validInputValues[input]); - assert.ok( - $input.parent('.validated-input.has-success'), - `${input} success` - ); - }); - click('#signup'); - }); + test('Invalid form submit', async function(assert) { + await visit('/'); + await click('[data-test-sign-up]'); - andThen(function() { - assert.ok(find('.form .registered img.tomster')); - assert.equal(find('.form .registered h2.success').text(), 'Success'); + assert + .dom('.form .alert') + .hasText('Please fix all the errors below before continuing.'); }); -}); -test('Invalid to valid email', function(assert) { - assert.expect(4); - visit('/'); - let $input; - andThen(function() { - $input = find('.validated-input input[name="email"]'); - assert.ok($input); - fillIn($input, 'invalid-email'); + test('Valid form submit', async function(assert) { + await visit('/'); + + for (let key in validInputValues) { + const selector = `[data-test-${dasherize(key)}]`; + const input = find(`${selector} input`); + + assert.ok(input, `${selector} found`); + await fillIn(input, validInputValues[key]); + assert.dom(selector).hasClass('has-success'); + } + + await click('[data-test-sign-up]'); + // assert.dom('[data-test-tomster]').exists(); + assert.dom('.form .registered .icon-success').exists(); + assert.dom('.form .registered h2.success').hasText('Success'); }); - andThen(function() { - assert.equal( - $input - .parent('.form-group') - .find('.input-error .error') - .text() - .trim(), - 'This field must be a valid email address' - ); - assert.ok($input.parent('.validated-input.has-error')); - - fillIn($input, validInputValues.email); - assert.ok($input.parent('.validated-input.has-success')); + test('Invalid to valid email', async function(assert) { + assert.expect(4); + await visit('/'); + + const input = find('[data-test-email] input'); + + assert.ok(input); + await fillIn(input, 'invalid-email'); + + assert.dom('[data-test-email]').hasClass('has-error'); + assert + .dom('[data-test-email] .input-error') + .hasText('This field must be a valid email address'); + + await fillIn(input, validInputValues.email); + assert.dom('[data-test-email]').hasClass('has-success'); }); }); diff --git a/tests/dummy/app/index.html b/tests/dummy/app/index.html index 0b9625ad..50a503c3 100644 --- a/tests/dummy/app/index.html +++ b/tests/dummy/app/index.html @@ -10,7 +10,6 @@ {{content-for 'head'}} - @@ -20,7 +19,6 @@ {{content-for 'body'}} - {{content-for 'body-footer'}} diff --git a/tests/dummy/app/styles/app.less b/tests/dummy/app/styles/app.scss similarity index 72% rename from tests/dummy/app/styles/app.less rename to tests/dummy/app/styles/app.scss index 59025da8..a4d11f3a 100644 --- a/tests/dummy/app/styles/app.less +++ b/tests/dummy/app/styles/app.scss @@ -1,8 +1,9 @@ -@accent-color: #f23818; +$accent-color: #f23818; -@import './navbar.less'; -@import './form.less'; -@import './code-snippet.less'; +@import 'ember-bootstrap/bootstrap'; +@import './navbar'; +@import './form'; +@import './code-snippet'; body, html { @@ -14,7 +15,7 @@ html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; - > div { + > div.ember-view { height: 100%; display: flex; flex-direction: column; diff --git a/tests/dummy/app/styles/code-snippet.less b/tests/dummy/app/styles/code-snippet.scss similarity index 82% rename from tests/dummy/app/styles/code-snippet.less rename to tests/dummy/app/styles/code-snippet.scss index 45212a22..16286dc1 100644 --- a/tests/dummy/app/styles/code-snippet.less +++ b/tests/dummy/app/styles/code-snippet.scss @@ -1,7 +1,7 @@ -@background-color: #fdfdfd; +$background-color: #fdfdfd; .snippet-container { - background: @background-color; + background: $background-color; align-self: flex-start; overflow: auto; width: 0; @@ -29,12 +29,12 @@ font-size: 12px; } li.active > a { - background-color: @background-color; + background-color: $background-color; color: #696969; } } .tab-content { - background-color: @background-color; + background-color: $background-color; max-height: 600px; overflow: auto; height: 100%; @@ -51,7 +51,7 @@ border: none; margin: 0; padding: 0; - background-color: @background-color; + background-color: $background-color; height: 100%; } } diff --git a/tests/dummy/app/styles/form.less b/tests/dummy/app/styles/form.scss similarity index 98% rename from tests/dummy/app/styles/form.less rename to tests/dummy/app/styles/form.scss index 3abe72ef..81ef5a94 100644 --- a/tests/dummy/app/styles/form.less +++ b/tests/dummy/app/styles/form.scss @@ -4,7 +4,7 @@ background: #ffffff; width: 485px; padding: 40px; - border-top: 5px solid @accent-color; + border-top: 5px solid $accent-color; border-radius: 3px; box-shadow: 5px 5px 10px 1px rgba(0, 0, 0, 0.15); z-index: 5; @@ -63,7 +63,7 @@ input.form-control:focus { .form h2 { margin: -15px 0 25px 0; line-height: 1; - color: @accent-color; + color: $accent-color; font-size: 18px; font-weight: 400; } @@ -101,7 +101,7 @@ input.form-control:focus { .form button { cursor: pointer; outline: none; - background: @accent-color; + background: $accent-color; width: 100%; padding: 10px 15px; margin-bottom: 25px; diff --git a/tests/dummy/app/styles/navbar.less b/tests/dummy/app/styles/navbar.scss similarity index 93% rename from tests/dummy/app/styles/navbar.less rename to tests/dummy/app/styles/navbar.scss index 9479afca..307285fb 100644 --- a/tests/dummy/app/styles/navbar.less +++ b/tests/dummy/app/styles/navbar.scss @@ -35,12 +35,12 @@ } .navbar-nav > li > a:focus, .navbar-nav > li > a:hover { - color: @accent-color; + color: $accent-color; } .navbar-nav > .active > a, .navbar-nav > .active > a:focus, .navbar-nav > .active > a:hover { - color: @accent-color; + color: $accent-color; background-color: transparent; } } diff --git a/tests/dummy/app/templates/application.hbs b/tests/dummy/app/templates/application.hbs index e5075e03..c6fbce89 100644 --- a/tests/dummy/app/templates/application.hbs +++ b/tests/dummy/app/templates/application.hbs @@ -1,37 +1,25 @@ - + + {{#navbar.content}} + {{#navbar.nav class="navbar-right" as |nav|}} + {{#nav.dropdown as |dd|}} + {{#dd.toggle}}Documentation {{/dd.toggle}} + {{#dd.menu as |ddm|}} + {{#ddm.item}}v3.x{{/ddm.item}} + {{#ddm.item}}v2.x{{/ddm.item}} + {{/dd.menu}} + {{/nav.dropdown}} + {{#nav.item}}{{/nav.item}} + {{/navbar.nav}} + {{/navbar.content}} +{{/bs-navbar}}
{{outlet}} diff --git a/tests/dummy/app/templates/index.hbs b/tests/dummy/app/templates/index.hbs index 227adbdb..6704dd79 100644 --- a/tests/dummy/app/templates/index.hbs +++ b/tests/dummy/app/templates/index.hbs @@ -17,10 +17,10 @@
{{/unless}} - {{validated-input model=model valuePath='username' placeholder='Username' didValidate=didValidate}} - {{validated-input type='password' model=model valuePath='password' placeholder='Password' didValidate=didValidate}} - {{validated-input model=model valuePath='email' placeholder='Email' didValidate=didValidate}} - {{validated-input model=model valuePath='emailConfirmation' placeholder='Verify Email' didValidate=didValidate}} + {{validated-input model=model valuePath='username' placeholder='Username' didValidate=didValidate data-test-username=''}} + {{validated-input type='password' model=model valuePath='password' placeholder='Password' didValidate=didValidate data-test-password=''}} + {{validated-input model=model valuePath='email' placeholder='Email' didValidate=didValidate data-test-email=''}} + {{validated-input model=model valuePath='emailConfirmation' placeholder='Verify Email' didValidate=didValidate data-test-email-confirmation=''}}

About Me

@@ -32,11 +32,11 @@ {{/unless}} - {{validated-input model=model.details valuePath='firstName' placeholder='First Name' didValidate=didValidate}} - {{validated-input model=model.details valuePath='lastName' placeholder='Last Name' didValidate=didValidate}} - {{validated-input model=model.details valuePath='dob' placeholder='Date of Birth' didValidate=didValidate}} - {{validated-input model=model.details valuePath='phone' placeholder='Phone #' didValidate=didValidate}} - {{validated-input model=model.details valuePath='url' placeholder='URL' didValidate=didValidate}} + {{validated-input model=model.details valuePath='firstName' placeholder='First Name' didValidate=didValidate data-test-first-name=''}} + {{validated-input model=model.details valuePath='lastName' placeholder='Last Name' didValidate=didValidate data-test-last-name=''}} + {{validated-input model=model.details valuePath='dob' placeholder='Date of Birth' didValidate=didValidate data-test-dob=''}} + {{validated-input model=model.details valuePath='phone' placeholder='Phone #' didValidate=didValidate data-test-phone=''}} + {{validated-input model=model.details valuePath='url' placeholder='URL' didValidate=didValidate data-test-url=''}}
{{#unless showCode}} @@ -44,13 +44,13 @@ On submit, a manual validation is run which will validate both the User and User Details models. If both are valid, then the user can continue to the next screen.
{{/unless}} - + {{else}}
- {{!-- --}} + {{!-- --}}

Success

@@ -66,17 +66,22 @@ {{#unless isRegistered}}
- -
-
{{code-snippet name='user-model.js'}}
-
{{code-snippet name='user-detail-model.js'}}
-
{{code-snippet name='validated-input.js'}}
-
{{code-snippet name='validated-input.hbs'}}
-
-
+ {{#bs-tab as |tab|}} + {{#tab.pane title="models/user.js"}} + {{code-snippet name='user-model.js'}} + {{/tab.pane}} + + {{#tab.pane title="models/user-detail.js"}} + {{code-snippet name='user-detail-model.js'}} + {{/tab.pane}} + + {{#tab.pane title="validated-input.js"}} + {{code-snippet name='validated-input.js'}} + {{/tab.pane}} + + {{#tab.pane title="validated-input.hbs"}} + {{code-snippet name='validated-input.hbs'}} + {{/tab.pane}} + {{/bs-tab}} + {{/unless}} diff --git a/tests/dummy/config/targets.js b/tests/dummy/config/targets.js index 082e68b5..8ffae363 100644 --- a/tests/dummy/config/targets.js +++ b/tests/dummy/config/targets.js @@ -1,8 +1,18 @@ +'use strict'; + +const browsers = [ + 'last 1 Chrome versions', + 'last 1 Firefox versions', + 'last 1 Safari versions' +]; + +const isCI = !!process.env.CI; +const isProduction = process.env.EMBER_ENV === 'production'; + +if (isCI || isProduction) { + browsers.push('ie 11'); +} + module.exports = { - browsers: [ - 'ie 9', - 'last 1 Chrome versions', - 'last 1 Firefox versions', - 'last 1 Safari versions' - ] + browsers }; diff --git a/tests/helpers/.gitkeep b/tests/helpers/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/tests/helpers/destroy-app.js b/tests/helpers/destroy-app.js deleted file mode 100644 index e7f983bd..00000000 --- a/tests/helpers/destroy-app.js +++ /dev/null @@ -1,5 +0,0 @@ -import { run } from '@ember/runloop'; - -export default function destroyApp(application) { - run(application, 'destroy'); -} diff --git a/tests/helpers/module-for-acceptance.js b/tests/helpers/module-for-acceptance.js deleted file mode 100644 index 5ed5f082..00000000 --- a/tests/helpers/module-for-acceptance.js +++ /dev/null @@ -1,22 +0,0 @@ -import { resolve } from 'rsvp'; -import { module } from 'qunit'; -import startApp from '../helpers/start-app'; -import destroyApp from '../helpers/destroy-app'; - -export default function(name, options = {}) { - module(name, { - beforeEach() { - this.application = startApp(); - - if (options.beforeEach) { - return options.beforeEach.apply(this, arguments); - } - }, - - afterEach() { - let afterEach = - options.afterEach && options.afterEach.apply(this, arguments); - return resolve(afterEach).then(() => destroyApp(this.application)); - } - }); -} diff --git a/tests/helpers/setup-object.js b/tests/helpers/setup-object.js index 2de71d94..d9c4c906 100644 --- a/tests/helpers/setup-object.js +++ b/tests/helpers/setup-object.js @@ -1,5 +1,3 @@ -import { getOwner } from '@ember/application'; - export default function(context, obj, options = {}) { - return obj.create(getOwner(context).ownerInjection(), options); + return obj.create(context.owner.ownerInjection(), options); } diff --git a/tests/helpers/start-app.js b/tests/helpers/start-app.js deleted file mode 100644 index 99d35dcf..00000000 --- a/tests/helpers/start-app.js +++ /dev/null @@ -1,17 +0,0 @@ -import Application from '../../app'; -import config from '../../config/environment'; -import { merge } from '@ember/polyfills'; -import { run } from '@ember/runloop'; - -export default function startApp(attrs) { - let attributes = merge({}, config.APP); - attributes.autoboot = true; - attributes = merge(attributes, attrs); // use defaults, but you can override; - - return run(() => { - let application = Application.create(attributes); - application.setupForTesting(); - application.injectTestHelpers(); - return application; - }); -} diff --git a/tests/integration/helpers/v-get-test.js b/tests/integration/helpers/v-get-test.js index 8e6276c2..8baa21eb 100644 --- a/tests/integration/helpers/v-get-test.js +++ b/tests/integration/helpers/v-get-test.js @@ -1,11 +1,14 @@ import EmberObject from '@ember/object'; -import { moduleForComponent, test } from 'ember-qunit'; +import { module, test } from 'qunit'; +import { setupRenderingTest } from 'ember-qunit'; +import { render } from '@ember/test-helpers'; import hbs from 'htmlbars-inline-precompile'; import '../../helpers/ensure-get-registered'; -moduleForComponent('helper:v-get', 'Integration | Helper | v-get', { - integration: true, - beforeEach() { +module('Integration | Helper | v-get', function(hooks) { + setupRenderingTest(hooks); + + hooks.beforeEach(function() { let model = EmberObject.create({ validations: { isValid: false, @@ -21,86 +24,85 @@ moduleForComponent('helper:v-get', 'Integration | Helper | v-get', { } } }); + this.set('model', model); - } -}); + }); -test('it renders', function(assert) { - assert.expect(1); + test('it renders', async function(assert) { + assert.expect(1); - this.render(hbs`{{v-get model 'isValid'}}`); - assert.equal(this._element.textContent.trim(), 'false'); -}); + await render(hbs`{{v-get model 'isValid'}}`); + assert.dom(this.element).hasText('false'); + }); -test('access attribute validations', function(assert) { - assert.expect(3); - this.render(hbs`{{v-get model 'username' 'isValid'}}`); - assert.equal(this._element.textContent.trim(), 'false'); + test('access attribute validations', async function(assert) { + assert.expect(3); - this.render(hbs`{{v-get model 'username' 'message'}}`); - assert.equal(this._element.textContent.trim(), 'This field is invalid'); + await render(hbs`{{v-get model 'username' 'isValid'}}`); + assert.dom(this.element).hasText('false'); - this.render(hbs`{{v-get model 'email' 'isValid'}}`); - assert.equal(this._element.textContent.trim(), 'true'); -}); + await render(hbs`{{v-get model 'username' 'message'}}`); + assert.dom(this.element).hasText('This field is invalid'); -test('updating validation should rerender', function(assert) { - assert.expect(2); + await render(hbs`{{v-get model 'email' 'isValid'}}`); + assert.dom(this.element).hasText('true'); + }); - this.render(hbs`{{v-get model 'username' 'isValid'}}`); - assert.equal(this._element.textContent.trim(), 'false'); + test('updating validation should rerender', async function(assert) { + assert.expect(2); - this.set('model.validations.attrs.username.isValid', true); + await render(hbs`{{v-get model 'username' 'isValid'}}`); + assert.dom(this.element).hasText('false'); - assert.equal(this._element.textContent.trim(), 'true'); -}); + this.set('model.validations.attrs.username.isValid', true); -test('block statement param', function(assert) { - assert.expect(2); + assert.dom(this.element).hasText('true'); + }); - this.render(hbs` - {{#if (v-get model 'email' 'isValid')}} - Email address is valid - {{/if}} - `); + test('block statement param', async function(assert) { + assert.expect(2); - assert.equal(this._element.textContent.trim(), 'Email address is valid'); + await render(hbs` + {{#if (v-get model 'email' 'isValid')}} + Email address is valid + {{/if}} + `); - this.render(hbs` - {{#unless (v-get model 'username' 'isValid')}} - {{v-get model 'username' 'message'}} - {{/unless}} - `); + assert.dom(this.element).hasText('Email address is valid'); - assert.equal(this._element.textContent.trim(), 'This field is invalid'); -}); + await render(hbs` + {{#unless (v-get model 'username' 'isValid')}} + {{v-get model 'username' 'message'}} + {{/unless}} + `); -test('element node attribute', function(assert) { - assert.expect(2); + assert.dom(this.element).hasText('This field is invalid'); + }); - this.render( - hbs`` - ); - assert.equal(this._element.textContent.trim(), 'Button'); + test('element node attribute', async function(assert) { + assert.expect(2); - assert.equal(this._element.querySelector('button').disabled, true); -}); + await render( + hbs`` + ); + + assert.dom(this.element).hasText('Button'); + assert.equal(this.element.querySelector('button').disabled, true); + }); + + test('element node attribute in class string', async function(assert) { + assert.expect(3); + + await render( + hbs`Text` + ); -test('element node attribute in class string', function(assert) { - assert.expect(3); - - this.render( - hbs`Text` - ); - assert.equal(this._element.textContent.trim(), 'Text'); - assert.equal( - this._element.querySelector('span').classList.contains('base'), - true, - 'base class present' - ); - assert.equal( - this._element.querySelector('span').classList.contains('has-error'), - true, - 'error class present' - ); + assert.dom(this.element).hasText('Text'); + assert + .dom(this.element.querySelector('span')) + .hasClass('base', 'base class present'); + assert + .dom(this.element.querySelector('span')) + .hasClass('has-error', 'error class present'); + }); }); diff --git a/tests/integration/validations/factory-dependent-keys-test.js b/tests/integration/validations/factory-dependent-keys-test.js index b774a521..76a53395 100644 --- a/tests/integration/validations/factory-dependent-keys-test.js +++ b/tests/integration/validations/factory-dependent-keys-test.js @@ -6,159 +6,122 @@ import CollectionValidator from 'dummy/validators/collection'; import LengthValidator from 'dummy/validators/length'; import DSErrorValidator from 'dummy/validators/ds-error'; import { validator, buildValidations } from 'ember-cp-validations'; -import { moduleFor, test } from 'ember-qunit'; +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; + +module('Integration | Validations | Factory - Dependent Keys', function(hooks) { + setupTest(hooks); + + test('collection validator creates correct dependent keys', function(assert) { + this.owner.register('validator:collection', CollectionValidator); + this.owner.register('validator:length', LengthValidator); + + let CollectionValidations = buildValidations({ + array: [ + validator('collection', true), + validator('length', { + is: 2, + message: 'Array must have {is} items' + }) + ] + }); + let obj = setupObject(this, EmberObject.extend(CollectionValidations), { + array: A(['foo', 'bar']) + }); -moduleFor('foo', 'Integration | Validations | Factory - Dependent Keys', { - integration: true -}); + assert.equal(obj.get('validations.attrs.array.isValid'), true); -test('collection validator creates correct dependent keys', function(assert) { - this.register('validator:collection', CollectionValidator); - this.register('validator:length', LengthValidator); + obj.get('array').removeObject('bar'); - let CollectionValidations = buildValidations({ - array: [ - validator('collection', true), - validator('length', { - is: 2, - message: 'Array must have {is} items' - }) - ] - }); - let obj = setupObject(this, EmberObject.extend(CollectionValidations), { - array: A(['foo', 'bar']) + assert.equal(obj.get('validations.attrs.array.isValid'), false); + assert.equal( + obj.get('validations.attrs.array.message'), + 'Array must have 2 items' + ); }); - assert.equal(obj.get('validations.attrs.array.isValid'), true); + test('ds-error validator creates correct dependent keys', function(assert) { + this.owner.register('validator:ds-error', DSErrorValidator); + this.owner.register('validator:length', LengthValidator); - obj.get('array').removeObject('bar'); + let DSErrorValidations = buildValidations({ + username: validator('ds-error') + }); + let obj = setupObject(this, EmberObject.extend(DSErrorValidations), { + errors: DS.Errors.create(), + username: '' + }); - assert.equal(obj.get('validations.attrs.array.isValid'), false); - assert.equal( - obj.get('validations.attrs.array.message'), - 'Array must have 2 items' - ); -}); + assert.equal(obj.get('validations.attrs.username.isValid'), true); -test('ds-error validator creates correct dependent keys', function(assert) { - this.register('validator:ds-error', DSErrorValidator); - this.register('validator:length', LengthValidator); + obj.get('errors').add('username', 'Username is not unique'); - let DSErrorValidations = buildValidations({ - username: validator('ds-error') - }); - let obj = setupObject(this, EmberObject.extend(DSErrorValidations), { - errors: DS.Errors.create(), - username: '' + assert.equal(obj.get('validations.attrs.username.isValid'), false); + assert.equal( + obj.get('validations.attrs.username.message'), + 'Username is not unique' + ); }); - assert.equal(obj.get('validations.attrs.username.isValid'), true); + test('nested ds-error validator creates correct dependent keys', function(assert) { + this.owner.register('validator:ds-error', DSErrorValidator); + this.owner.register('validator:length', LengthValidator); - obj.get('errors').add('username', 'Username is not unique'); + let DSErrorValidations = buildValidations({ + 'model.username': validator('ds-error') + }); - assert.equal(obj.get('validations.attrs.username.isValid'), false); - assert.equal( - obj.get('validations.attrs.username.message'), - 'Username is not unique' - ); -}); + let obj = setupObject(this, EmberObject.extend(DSErrorValidations), { + model: EmberObject.create({ + errors: DS.Errors.create(), + username: '' + }) + }); -test('nested ds-error validator creates correct dependent keys', function(assert) { - this.register('validator:ds-error', DSErrorValidator); - this.register('validator:length', LengthValidator); + assert.equal(obj.get('validations.attrs.model.username.isValid'), true); - let DSErrorValidations = buildValidations({ - 'model.username': validator('ds-error') - }); + obj.get('model.errors').add('username', 'Username is not unique'); - let obj = setupObject(this, EmberObject.extend(DSErrorValidations), { - model: EmberObject.create({ - errors: DS.Errors.create(), - username: '' - }) + assert.equal(obj.get('validations.attrs.model.username.isValid'), false); + assert.equal( + obj.get('validations.attrs.model.username.message'), + 'Username is not unique' + ); }); - assert.equal(obj.get('validations.attrs.model.username.isValid'), true); - - obj.get('model.errors').add('username', 'Username is not unique'); - - assert.equal(obj.get('validations.attrs.model.username.isValid'), false); - assert.equal( - obj.get('validations.attrs.model.username.message'), - 'Username is not unique' - ); -}); - -test('custom dependent keys - simple', function(assert) { - let Validations = buildValidations({ - fullName: validator('inline', { - dependentKeys: ['model.firstName', 'model.lastName'], - validate(value, options, model) { - let firstName = model.get('firstName'); - let lastName = model.get('lastName'); - if (!firstName || !lastName) { - return 'Full name requires first and last name'; + test('custom dependent keys - simple', function(assert) { + let Validations = buildValidations({ + fullName: validator('inline', { + dependentKeys: ['model.firstName', 'model.lastName'], + validate(value, options, model) { + let firstName = model.get('firstName'); + let lastName = model.get('lastName'); + if (!firstName || !lastName) { + return 'Full name requires first and last name'; + } + return true; } - return true; - } - }) - }); - - let obj = setupObject(this, EmberObject.extend(Validations)); + }) + }); - assert.equal(obj.get('validations.isValid'), false); - assert.equal(obj.get('validations.attrs.fullName.isValid'), false); - assert.equal( - obj.get('validations.attrs.fullName.message'), - 'Full name requires first and last name' - ); + let obj = setupObject(this, EmberObject.extend(Validations)); - obj.set('firstName', 'Offir'); - obj.set('lastName', 'Golan'); + assert.equal(obj.get('validations.isValid'), false); + assert.equal(obj.get('validations.attrs.fullName.isValid'), false); + assert.equal( + obj.get('validations.attrs.fullName.message'), + 'Full name requires first and last name' + ); - assert.equal(obj.get('validations.isValid'), true); - assert.equal(obj.get('validations.attrs.fullName.isValid'), true); -}); + obj.set('firstName', 'Offir'); + obj.set('lastName', 'Golan'); -test('custom dependent keys - default options', function(assert) { - let Validations = buildValidations({ - fullName: { - dependentKeys: ['model.firstName'], - validators: [ - validator('inline', { - dependentKeys: ['model.lastName'], - validate(value, options, model) { - let firstName = model.get('firstName'); - let lastName = model.get('lastName'); - if (!firstName || !lastName) { - return 'Full name requires first and last name'; - } - return true; - } - }) - ] - } + assert.equal(obj.get('validations.isValid'), true); + assert.equal(obj.get('validations.attrs.fullName.isValid'), true); }); - let obj = setupObject(this, EmberObject.extend(Validations)); - - assert.equal(obj.get('validations.isValid'), false); - assert.equal(obj.get('validations.attrs.fullName.isValid'), false); - assert.equal( - obj.get('validations.attrs.fullName.message'), - 'Full name requires first and last name' - ); - - obj.set('firstName', 'Offir'); - obj.set('lastName', 'Golan'); - - assert.equal(obj.get('validations.isValid'), true); - assert.equal(obj.get('validations.attrs.fullName.isValid'), true); -}); - -test('custom dependent keys - global options', function(assert) { - let Validations = buildValidations( - { + test('custom dependent keys - default options', function(assert) { + let Validations = buildValidations({ fullName: { dependentKeys: ['model.firstName'], validators: [ @@ -167,169 +130,207 @@ test('custom dependent keys - global options', function(assert) { validate(value, options, model) { let firstName = model.get('firstName'); let lastName = model.get('lastName'); - let middleName = model.get('middleName'); - if (!firstName || !lastName || !middleName) { - return 'Full name requires first, middle, and last name'; + if (!firstName || !lastName) { + return 'Full name requires first and last name'; } return true; } }) ] } - }, - { - dependentKeys: ['model.middleName'] - } - ); - - let obj = setupObject(this, EmberObject.extend(Validations)); + }); - assert.equal(obj.get('validations.isValid'), false); - assert.equal(obj.get('validations.attrs.fullName.isValid'), false); - assert.equal( - obj.get('validations.attrs.fullName.message'), - 'Full name requires first, middle, and last name' - ); + let obj = setupObject(this, EmberObject.extend(Validations)); - obj.set('firstName', 'Offir'); - obj.set('lastName', 'Golan'); + assert.equal(obj.get('validations.isValid'), false); + assert.equal(obj.get('validations.attrs.fullName.isValid'), false); + assert.equal( + obj.get('validations.attrs.fullName.message'), + 'Full name requires first and last name' + ); - assert.equal(obj.get('validations.isValid'), false); - assert.equal(obj.get('validations.attrs.fullName.isValid'), false); + obj.set('firstName', 'Offir'); + obj.set('lastName', 'Golan'); - obj.set('middleName', 'David'); - - assert.equal(obj.get('validations.isValid'), true); - assert.equal(obj.get('validations.attrs.fullName.isValid'), true); -}); + assert.equal(obj.get('validations.isValid'), true); + assert.equal(obj.get('validations.attrs.fullName.isValid'), true); + }); -test('custom dependent keys - nested object', function(assert) { - let Validations = buildValidations({ - page: validator('inline', { - dependentKeys: ['model.currPage', 'model.meta.pages.last'], - validate(value, options, model) { - let currPage = model.get('currPage'); - let lastPage = model.get('meta.pages.last'); - if (currPage > lastPage) { - return 'Cannot exceed max page'; + test('custom dependent keys - global options', function(assert) { + let Validations = buildValidations( + { + fullName: { + dependentKeys: ['model.firstName'], + validators: [ + validator('inline', { + dependentKeys: ['model.lastName'], + validate(value, options, model) { + let firstName = model.get('firstName'); + let lastName = model.get('lastName'); + let middleName = model.get('middleName'); + if (!firstName || !lastName || !middleName) { + return 'Full name requires first, middle, and last name'; + } + return true; + } + }) + ] } - return true; + }, + { + dependentKeys: ['model.middleName'] } - }) - }); + ); - let obj = setupObject(this, EmberObject.extend(Validations), { - meta: { - pages: { - last: 5 - } - }, - currPage: 4 - }); + let obj = setupObject(this, EmberObject.extend(Validations)); - assert.equal(obj.get('validations.isValid'), true); - assert.equal(obj.get('validations.attrs.page.isValid'), true); + assert.equal(obj.get('validations.isValid'), false); + assert.equal(obj.get('validations.attrs.fullName.isValid'), false); + assert.equal( + obj.get('validations.attrs.fullName.message'), + 'Full name requires first, middle, and last name' + ); - obj.set('currPage', 6); + obj.set('firstName', 'Offir'); + obj.set('lastName', 'Golan'); - assert.equal(obj.get('validations.isValid'), false); - assert.equal(obj.get('validations.attrs.page.isValid'), false); - assert.equal( - obj.get('validations.attrs.page.message'), - 'Cannot exceed max page' - ); + assert.equal(obj.get('validations.isValid'), false); + assert.equal(obj.get('validations.attrs.fullName.isValid'), false); - obj.set('meta.pages.last', 7); + obj.set('middleName', 'David'); - assert.equal(obj.get('validations.isValid'), true); - assert.equal(obj.get('validations.attrs.page.isValid'), true); -}); + assert.equal(obj.get('validations.isValid'), true); + assert.equal(obj.get('validations.attrs.fullName.isValid'), true); + }); -test('custom dependent keys - array', function(assert) { - let Validations = buildValidations({ - friends: validator('inline', { - dependentKeys: ['model.friends.[]'], - validate(value, options, model) { - let friends = model.get('friends'); - if (!friends || friends.length === 0) { - return 'User must have a friend'; + test('custom dependent keys - nested object', function(assert) { + let Validations = buildValidations({ + page: validator('inline', { + dependentKeys: ['model.currPage', 'model.meta.pages.last'], + validate(value, options, model) { + let currPage = model.get('currPage'); + let lastPage = model.get('meta.pages.last'); + if (currPage > lastPage) { + return 'Cannot exceed max page'; + } + return true; } - return true; - } - }) - }); + }) + }); - let obj = setupObject(this, EmberObject.extend(Validations), { - friends: A() - }); + let obj = setupObject(this, EmberObject.extend(Validations), { + meta: { + pages: { + last: 5 + } + }, + currPage: 4 + }); - assert.equal(obj.get('validations.isValid'), false); - assert.equal(obj.get('validations.attrs.friends.isValid'), false); - assert.equal( - obj.get('validations.attrs.friends.message'), - 'User must have a friend' - ); + assert.equal(obj.get('validations.isValid'), true); + assert.equal(obj.get('validations.attrs.page.isValid'), true); - obj.get('friends').pushObject('Offir'); + obj.set('currPage', 6); - assert.equal(obj.get('validations.isValid'), true); - assert.equal(obj.get('validations.attrs.friends.isValid'), true); + assert.equal(obj.get('validations.isValid'), false); + assert.equal(obj.get('validations.attrs.page.isValid'), false); + assert.equal( + obj.get('validations.attrs.page.message'), + 'Cannot exceed max page' + ); - obj.get('friends').removeObject('Offir'); + obj.set('meta.pages.last', 7); - assert.equal(obj.get('validations.isValid'), false); - assert.equal(obj.get('validations.attrs.friends.isValid'), false); - assert.equal( - obj.get('validations.attrs.friends.message'), - 'User must have a friend' - ); -}); + assert.equal(obj.get('validations.isValid'), true); + assert.equal(obj.get('validations.attrs.page.isValid'), true); + }); -test('custom dependent keys - array of objects', function(assert) { - let Validations = buildValidations({ - friends: validator('inline', { - dependentKeys: ['model.friends.@each.name'], - validate(value, options, model) { - let friends = model.get('friends'); - if (!friends || friends.length === 0) { - return 'User must have a friend'; - } else if (friends.length > 0) { - let names = friends.filter(f => f.name); - if (names.length !== friends.length) { - return 'All friends must have a name'; + test('custom dependent keys - array', function(assert) { + let Validations = buildValidations({ + friends: validator('inline', { + dependentKeys: ['model.friends.[]'], + validate(value, options, model) { + let friends = model.get('friends'); + if (!friends || friends.length === 0) { + return 'User must have a friend'; } + return true; } - return true; - } - }) - }); + }) + }); + + let obj = setupObject(this, EmberObject.extend(Validations), { + friends: A() + }); + + assert.equal(obj.get('validations.isValid'), false); + assert.equal(obj.get('validations.attrs.friends.isValid'), false); + assert.equal( + obj.get('validations.attrs.friends.message'), + 'User must have a friend' + ); - let obj = setupObject(this, EmberObject.extend(Validations), { - friends: A() + obj.get('friends').pushObject('Offir'); + + assert.equal(obj.get('validations.isValid'), true); + assert.equal(obj.get('validations.attrs.friends.isValid'), true); + + obj.get('friends').removeObject('Offir'); + + assert.equal(obj.get('validations.isValid'), false); + assert.equal(obj.get('validations.attrs.friends.isValid'), false); + assert.equal( + obj.get('validations.attrs.friends.message'), + 'User must have a friend' + ); }); - assert.equal(obj.get('validations.isValid'), false); - assert.equal(obj.get('validations.attrs.friends.isValid'), false); - assert.equal( - obj.get('validations.attrs.friends.message'), - 'User must have a friend' - ); - - obj.get('friends').pushObject( - EmberObject.create({ - name: 'Offir' - }) - ); - - assert.equal(obj.get('validations.isValid'), true); - assert.equal(obj.get('validations.attrs.friends.isValid'), true); - - obj.get('friends.0').set('name', undefined); - - assert.equal(obj.get('validations.isValid'), false); - assert.equal(obj.get('validations.attrs.friends.isValid'), false); - assert.equal( - obj.get('validations.attrs.friends.message'), - 'All friends must have a name' - ); + test('custom dependent keys - array of objects', function(assert) { + let Validations = buildValidations({ + friends: validator('inline', { + dependentKeys: ['model.friends.@each.name'], + validate(value, options, model) { + let friends = model.get('friends'); + if (!friends || friends.length === 0) { + return 'User must have a friend'; + } else if (friends.length > 0) { + let names = friends.filter(f => f.name); + if (names.length !== friends.length) { + return 'All friends must have a name'; + } + } + return true; + } + }) + }); + + let obj = setupObject(this, EmberObject.extend(Validations), { + friends: A() + }); + + assert.equal(obj.get('validations.isValid'), false); + assert.equal(obj.get('validations.attrs.friends.isValid'), false); + assert.equal( + obj.get('validations.attrs.friends.message'), + 'User must have a friend' + ); + + obj.get('friends').pushObject( + EmberObject.create({ + name: 'Offir' + }) + ); + + assert.equal(obj.get('validations.isValid'), true); + assert.equal(obj.get('validations.attrs.friends.isValid'), true); + + obj.get('friends.0').set('name', undefined); + + assert.equal(obj.get('validations.isValid'), false); + assert.equal(obj.get('validations.attrs.friends.isValid'), false); + assert.equal( + obj.get('validations.attrs.friends.message'), + 'All friends must have a name' + ); + }); }); diff --git a/tests/integration/validations/factory-general-test.js b/tests/integration/validations/factory-general-test.js index 9c919af6..be2ea32f 100644 --- a/tests/integration/validations/factory-general-test.js +++ b/tests/integration/validations/factory-general-test.js @@ -11,7 +11,8 @@ import DefaultMessages from 'dummy/validators/messages'; import PresenceValidator from 'dummy/validators/presence'; import LengthValidator from 'dummy/validators/length'; import { validator, buildValidations } from 'ember-cp-validations'; -import { moduleFor, test } from 'ember-qunit'; +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; import { ATTRS_MODEL } from 'ember-cp-validations/-private/symbols'; const Validators = { @@ -28,1572 +29,1613 @@ let Validations = buildValidations({ lastName: validator('inline', { validate: Validators.presence }) }); -moduleFor('foo', 'Integration | Validations | Factory - General', { - integration: true -}); - -test('it works', function(assert) { - assert.ok(buildValidations()); -}); +module('Integration | Validations | Factory - General', function(hooks) { + setupTest(hooks); -test('basic sync validation – invalid', function(assert) { - let object = setupObject(this, EmberObject.extend(Validations)); - - assert.equal( - object.get('validations.isValid'), - false, - 'isValid was expected to be FALSE' - ); - assert.equal( - object.get('validations.isValidating'), - false, - 'isValidating was expected to be FALSE' - ); - assert.equal( - object.get('validations.isTruelyValid'), - false, - 'isTruelyValid was expected to be FALSE' - ); - assert.equal( - object.get('validations.isTruelyInvalid'), - true, - 'isTruelyInvalid was expected to be TRUE' - ); - - assert.equal(object.get('validations.attrs.firstName.isValid'), false); - assert.equal(object.get('validations.attrs.firstName.isValidating'), false); - assert.equal( - object.get('validations.attrs.firstName.message'), - 'firstName should be present' - ); - - assert.equal(object.get('validations.attrs.lastName.isValid'), false); - assert.equal(object.get('validations.attrs.lastName.isValidating'), false); - assert.equal( - object.get('validations.attrs.lastName.message'), - 'lastName should be present' - ); - - assert.equal( - object.get('validations.errors.length'), - 2, - 'errors length was expected to be 2' - ); - assert.ok( - object - .get('validations.errors') - .indexOf(object.get('validations.attrs.firstName.errors.0')) > -1, - 'errors was expected to contain firstName error' - ); - assert.ok( - object - .get('validations.errors') - .indexOf(object.get('validations.attrs.lastName.errors.0')) > -1, - 'errors was expected to contain lastName error' - ); - assert.equal( - object.get('validations.errors.0.attribute'), - 'firstName', - "error object was expected to have attribute 'firstName'" - ); - assert.equal( - object.get('validations.errors.1.attribute'), - 'lastName', - "error object was expected to have attribute 'lastName'" - ); - - object.set('firstName', 'stef'); - object.set('lastName', 'penner'); - - assert.equal( - object.get('validations.isValid'), - true, - 'isValid was expected to be TRUE' - ); - assert.equal( - object.get('validations.isValidating'), - false, - 'isValidating was expected to be TRUE' - ); - assert.equal( - object.get('validations.isTruelyValid'), - true, - 'isTruelyValid was expected to be TRUE' - ); - assert.equal( - object.get('validations.isTruelyInvalid'), - false, - 'isTruelyInvalid was expected to be FALSE' - ); - - assert.equal(object.get('validations.attrs.firstName.isValid'), true); - assert.equal(object.get('validations.attrs.firstName.isValidating'), false); - assert.equal(object.get('validations.attrs.firstName.message'), null); - - assert.equal(object.get('validations.attrs.lastName.isValid'), true); - assert.equal(object.get('validations.attrs.lastName.isValidating'), false); - assert.equal(object.get('validations.attrs.lastName.message'), null); - - assert.equal( - object.get('validations.errors.length'), - 0, - 'errors length was expected to be 0' - ); -}); - -test('basic sync validation - valid', function(assert) { - let object = setupObject(this, EmberObject.extend(Validations), { - firstName: 'Stef', - lastName: 'Penner' + test('it works', function(assert) { + assert.ok(buildValidations()); }); - assert.equal( - object.get('validations.isValid'), - true, - 'isValid was expected to be TRUE' - ); - assert.equal( - object.get('validations.isValidating'), - false, - 'isValidating was expected to be FALSE' - ); - assert.equal( - object.get('validations.isTruelyValid'), - true, - 'isTruelyValid was expected to be TRUE' - ); - assert.equal( - object.get('validations.isTruelyInvalid'), - false, - 'isTruelyInvalid was expected to be FALSE' - ); - - assert.equal(object.get('validations.attrs.firstName.isValid'), true); - assert.equal(object.get('validations.attrs.firstName.isValidating'), false); - assert.equal(object.get('validations.attrs.firstName.message'), null); - - assert.equal(object.get('validations.attrs.lastName.isValid'), true); - assert.equal(object.get('validations.attrs.lastName.isValidating'), false); - assert.equal(object.get('validations.attrs.lastName.message'), null); -}); - -test('basic sync validation - 50% invalid', function(assert) { - let object = setupObject(this, EmberObject.extend(Validations), { - firstName: 'Stef' - }); + test('basic sync validation – invalid', function(assert) { + let object = setupObject(this, EmberObject.extend(Validations)); + + assert.equal( + object.get('validations.isValid'), + false, + 'isValid was expected to be FALSE' + ); + assert.equal( + object.get('validations.isValidating'), + false, + 'isValidating was expected to be FALSE' + ); + assert.equal( + object.get('validations.isTruelyValid'), + false, + 'isTruelyValid was expected to be FALSE' + ); + assert.equal( + object.get('validations.isTruelyInvalid'), + true, + 'isTruelyInvalid was expected to be TRUE' + ); + + assert.equal(object.get('validations.attrs.firstName.isValid'), false); + assert.equal(object.get('validations.attrs.firstName.isValidating'), false); + assert.equal( + object.get('validations.attrs.firstName.message'), + 'firstName should be present' + ); + + assert.equal(object.get('validations.attrs.lastName.isValid'), false); + assert.equal(object.get('validations.attrs.lastName.isValidating'), false); + assert.equal( + object.get('validations.attrs.lastName.message'), + 'lastName should be present' + ); + + assert.equal( + object.get('validations.errors.length'), + 2, + 'errors length was expected to be 2' + ); + assert.ok( + object + .get('validations.errors') + .indexOf(object.get('validations.attrs.firstName.errors.0')) > -1, + 'errors was expected to contain firstName error' + ); + assert.ok( + object + .get('validations.errors') + .indexOf(object.get('validations.attrs.lastName.errors.0')) > -1, + 'errors was expected to contain lastName error' + ); + assert.equal( + object.get('validations.errors.0.attribute'), + 'firstName', + "error object was expected to have attribute 'firstName'" + ); + assert.equal( + object.get('validations.errors.1.attribute'), + 'lastName', + "error object was expected to have attribute 'lastName'" + ); + + object.set('firstName', 'stef'); + object.set('lastName', 'penner'); + + assert.equal( + object.get('validations.isValid'), + true, + 'isValid was expected to be TRUE' + ); + assert.equal( + object.get('validations.isValidating'), + false, + 'isValidating was expected to be TRUE' + ); + assert.equal( + object.get('validations.isTruelyValid'), + true, + 'isTruelyValid was expected to be TRUE' + ); + assert.equal( + object.get('validations.isTruelyInvalid'), + false, + 'isTruelyInvalid was expected to be FALSE' + ); + + assert.equal(object.get('validations.attrs.firstName.isValid'), true); + assert.equal(object.get('validations.attrs.firstName.isValidating'), false); + assert.equal(object.get('validations.attrs.firstName.message'), null); - assert.equal( - object.get('validations.isValid'), - false, - 'isValid was expected to be FALSE' - ); - assert.equal( - object.get('validations.isValidating'), - false, - 'isValidating was expected to be FALSE' - ); - assert.equal( - object.get('validations.isTruelyValid'), - false, - 'isTruelyValid was expected to be FALSE' - ); - assert.equal( - object.get('validations.isTruelyInvalid'), - true, - 'isTruelyInvalid was expected to be TRUE' - ); - - assert.equal(object.get('validations.attrs.firstName.isValid'), true); - assert.equal(object.get('validations.attrs.firstName.isValidating'), false); - assert.equal(object.get('validations.attrs.firstName.message'), null); - - assert.equal(object.get('validations.attrs.lastName.isValid'), false); - assert.equal(object.get('validations.attrs.lastName.isValidating'), false); - assert.equal( - object.get('validations.attrs.lastName.message'), - 'lastName should be present' - ); -}); + assert.equal(object.get('validations.attrs.lastName.isValid'), true); + assert.equal(object.get('validations.attrs.lastName.isValidating'), false); + assert.equal(object.get('validations.attrs.lastName.message'), null); -test('basic sync validation - API - #validation', function(assert) { - let object = setupObject(this, EmberObject.extend(Validations), { - firstName: 'Stef' + assert.equal( + object.get('validations.errors.length'), + 0, + 'errors length was expected to be 0' + ); }); - return object - .get('validations') - .validate() - .then(({ validations, model }) => { - assert.equal(model, object, 'expected model to be the correct model'); - assert.deepEqual( - validations - .get('content') - .getEach('attribute') - .sort(), - ['firstName', 'lastName'].sort() - ); - - let firstName = validations - .get('content') - .findBy('attribute', 'firstName'); - let lastName = validations.get('content').findBy('attribute', 'lastName'); + test('basic sync validation - valid', function(assert) { + let object = setupObject(this, EmberObject.extend(Validations), { + firstName: 'Stef', + lastName: 'Penner' + }); - assert.equal(firstName.get('isValid'), true); - assert.equal(firstName.get('isValidating'), false); - assert.equal(firstName.get('message'), undefined); + assert.equal( + object.get('validations.isValid'), + true, + 'isValid was expected to be TRUE' + ); + assert.equal( + object.get('validations.isValidating'), + false, + 'isValidating was expected to be FALSE' + ); + assert.equal( + object.get('validations.isTruelyValid'), + true, + 'isTruelyValid was expected to be TRUE' + ); + assert.equal( + object.get('validations.isTruelyInvalid'), + false, + 'isTruelyInvalid was expected to be FALSE' + ); + + assert.equal(object.get('validations.attrs.firstName.isValid'), true); + assert.equal(object.get('validations.attrs.firstName.isValidating'), false); + assert.equal(object.get('validations.attrs.firstName.message'), null); - assert.equal(lastName.get('isValid'), false); - assert.equal(lastName.get('isValidating'), false); - assert.equal(lastName.get('message'), 'lastName should be present'); + assert.equal(object.get('validations.attrs.lastName.isValid'), true); + assert.equal(object.get('validations.attrs.lastName.isValidating'), false); + assert.equal(object.get('validations.attrs.lastName.message'), null); + }); - assert.equal( - object.get('validations.isValid'), - false, - 'isValid was expected to be FALSE' - ); - assert.equal( - object.get('validations.isValidating'), - false, - 'isValidating was expected to be FALSE' - ); - assert.equal( - object.get('validations.isTruelyValid'), - false, - 'isTruelyValid was expected to be FALSE' - ); - assert.equal( - object.get('validations.isTruelyInvalid'), - true, - 'isTruelyInvalid was expected to be TRUE' - ); + test('basic sync validation - 50% invalid', function(assert) { + let object = setupObject(this, EmberObject.extend(Validations), { + firstName: 'Stef' + }); - assert.equal(object.get('validations.attrs.firstName.isValid'), true); - assert.equal( - object.get('validations.attrs.firstName.isValidating'), - false - ); - assert.equal(object.get('validations.attrs.firstName.message'), null); + assert.equal( + object.get('validations.isValid'), + false, + 'isValid was expected to be FALSE' + ); + assert.equal( + object.get('validations.isValidating'), + false, + 'isValidating was expected to be FALSE' + ); + assert.equal( + object.get('validations.isTruelyValid'), + false, + 'isTruelyValid was expected to be FALSE' + ); + assert.equal( + object.get('validations.isTruelyInvalid'), + true, + 'isTruelyInvalid was expected to be TRUE' + ); + + assert.equal(object.get('validations.attrs.firstName.isValid'), true); + assert.equal(object.get('validations.attrs.firstName.isValidating'), false); + assert.equal(object.get('validations.attrs.firstName.message'), null); + + assert.equal(object.get('validations.attrs.lastName.isValid'), false); + assert.equal(object.get('validations.attrs.lastName.isValidating'), false); + assert.equal( + object.get('validations.attrs.lastName.message'), + 'lastName should be present' + ); + }); - assert.equal(object.get('validations.attrs.lastName.isValid'), false); - assert.equal( - object.get('validations.attrs.lastName.isValidating'), - false - ); - assert.equal( - object.get('validations.attrs.lastName.message'), - 'lastName should be present' - ); + test('basic sync validation - API - #validation', function(assert) { + let object = setupObject(this, EmberObject.extend(Validations), { + firstName: 'Stef' }); -}); -test('basic sync validation - API - #validationSync', function(assert) { - let object = setupObject(this, EmberObject.extend(Validations), { - firstName: 'Stef' + return object + .get('validations') + .validate() + .then(({ validations, model }) => { + assert.equal(model, object, 'expected model to be the correct model'); + assert.deepEqual( + validations + .get('content') + .getEach('attribute') + .sort(), + ['firstName', 'lastName'].sort() + ); + + let firstName = validations + .get('content') + .findBy('attribute', 'firstName'); + let lastName = validations + .get('content') + .findBy('attribute', 'lastName'); + + assert.equal(firstName.get('isValid'), true); + assert.equal(firstName.get('isValidating'), false); + assert.equal(firstName.get('message'), undefined); + + assert.equal(lastName.get('isValid'), false); + assert.equal(lastName.get('isValidating'), false); + assert.equal(lastName.get('message'), 'lastName should be present'); + + assert.equal( + object.get('validations.isValid'), + false, + 'isValid was expected to be FALSE' + ); + assert.equal( + object.get('validations.isValidating'), + false, + 'isValidating was expected to be FALSE' + ); + assert.equal( + object.get('validations.isTruelyValid'), + false, + 'isTruelyValid was expected to be FALSE' + ); + assert.equal( + object.get('validations.isTruelyInvalid'), + true, + 'isTruelyInvalid was expected to be TRUE' + ); + + assert.equal(object.get('validations.attrs.firstName.isValid'), true); + assert.equal( + object.get('validations.attrs.firstName.isValidating'), + false + ); + assert.equal(object.get('validations.attrs.firstName.message'), null); + + assert.equal(object.get('validations.attrs.lastName.isValid'), false); + assert.equal( + object.get('validations.attrs.lastName.isValidating'), + false + ); + assert.equal( + object.get('validations.attrs.lastName.message'), + 'lastName should be present' + ); + }); }); - let { validations, model } = object.get('validations').validateSync(); - - assert.equal(model, object, 'expected model to be the correct model'); - assert.deepEqual( - validations - .get('content') - .getEach('attribute') - .sort(), - ['firstName', 'lastName'].sort() - ); - - let firstName = validations.get('content').findBy('attribute', 'firstName'); - let lastName = validations.get('content').findBy('attribute', 'lastName'); - - assert.equal(firstName.get('isValid'), true); - assert.equal(firstName.get('isValidating'), false); - assert.equal(firstName.get('message'), undefined); - - assert.equal(lastName.get('isValid'), false); - assert.equal(lastName.get('isValidating'), false); - assert.equal(lastName.get('message'), 'lastName should be present'); - - assert.equal( - object.get('validations.isValid'), - false, - 'isValid was expected to be FALSE' - ); - assert.equal( - object.get('validations.isValidating'), - false, - 'isValidating was expected to be FALSE' - ); - assert.equal( - object.get('validations.isTruelyValid'), - false, - 'isTruelyValid was expected to be FALSE' - ); - assert.equal( - object.get('validations.isTruelyInvalid'), - true, - 'isTruelyInvalid was expected to be TRUE' - ); - - assert.equal(object.get('validations.attrs.firstName.isValid'), true); - assert.equal(object.get('validations.attrs.firstName.isValidating'), false); - assert.equal(object.get('validations.attrs.firstName.message'), null); - - assert.equal(object.get('validations.attrs.lastName.isValid'), false); - assert.equal(object.get('validations.attrs.lastName.isValidating'), false); - assert.equal( - object.get('validations.attrs.lastName.message'), - 'lastName should be present' - ); -}); + test('basic sync validation - API - #validationSync', function(assert) { + let object = setupObject(this, EmberObject.extend(Validations), { + firstName: 'Stef' + }); -test('basic sync validation returns null', function(assert) { - let Validations = buildValidations({ - firstName: validator('inline', { validate: () => null }) - }); - let object = setupObject(this, EmberObject.extend(Validations), { - firstName: 'Offir' + let { validations, model } = object.get('validations').validateSync(); + + assert.equal(model, object, 'expected model to be the correct model'); + assert.deepEqual( + validations + .get('content') + .getEach('attribute') + .sort(), + ['firstName', 'lastName'].sort() + ); + + let firstName = validations.get('content').findBy('attribute', 'firstName'); + let lastName = validations.get('content').findBy('attribute', 'lastName'); + + assert.equal(firstName.get('isValid'), true); + assert.equal(firstName.get('isValidating'), false); + assert.equal(firstName.get('message'), undefined); + + assert.equal(lastName.get('isValid'), false); + assert.equal(lastName.get('isValidating'), false); + assert.equal(lastName.get('message'), 'lastName should be present'); + + assert.equal( + object.get('validations.isValid'), + false, + 'isValid was expected to be FALSE' + ); + assert.equal( + object.get('validations.isValidating'), + false, + 'isValidating was expected to be FALSE' + ); + assert.equal( + object.get('validations.isTruelyValid'), + false, + 'isTruelyValid was expected to be FALSE' + ); + assert.equal( + object.get('validations.isTruelyInvalid'), + true, + 'isTruelyInvalid was expected to be TRUE' + ); + + assert.equal(object.get('validations.attrs.firstName.isValid'), true); + assert.equal(object.get('validations.attrs.firstName.isValidating'), false); + assert.equal(object.get('validations.attrs.firstName.message'), null); + + assert.equal(object.get('validations.attrs.lastName.isValid'), false); + assert.equal(object.get('validations.attrs.lastName.isValidating'), false); + assert.equal( + object.get('validations.attrs.lastName.message'), + 'lastName should be present' + ); }); - assert.equal( - object.get('validations.isValid'), - false, - 'isValid was expected to be FALSE' - ); - assert.equal( - object.get('validations.isValidating'), - false, - 'isValidating was expected to be FALSE' - ); - assert.equal( - object.get('validations.isTruelyValid'), - false, - 'isTruelyValid was expected to be FALSE' - ); - assert.equal( - object.get('validations.isTruelyInvalid'), - true, - 'isTruelyInvalid was expected to be TRUE' - ); - - assert.equal(object.get('validations.attrs.firstName.isValid'), false); - assert.equal(object.get('validations.attrs.firstName.isValidating'), false); - assert.equal(object.get('validations.attrs.firstName.message'), undefined); -}); + test('basic sync validation returns null', function(assert) { + let Validations = buildValidations({ + firstName: validator('inline', { validate: () => null }) + }); + let object = setupObject(this, EmberObject.extend(Validations), { + firstName: 'Offir' + }); -test('shallow isAsync test', function(assert) { - let Validations = buildValidations({ - firstName: validator('inline', { - validate() { - return new EmberPromise(resolve => { - resolve(true); - }); - } - }) + assert.equal( + object.get('validations.isValid'), + false, + 'isValid was expected to be FALSE' + ); + assert.equal( + object.get('validations.isValidating'), + false, + 'isValidating was expected to be FALSE' + ); + assert.equal( + object.get('validations.isTruelyValid'), + false, + 'isTruelyValid was expected to be FALSE' + ); + assert.equal( + object.get('validations.isTruelyInvalid'), + true, + 'isTruelyInvalid was expected to be TRUE' + ); + + assert.equal(object.get('validations.attrs.firstName.isValid'), false); + assert.equal(object.get('validations.attrs.firstName.isValidating'), false); + assert.equal(object.get('validations.attrs.firstName.message'), undefined); }); - let obj = setupObject(this, EmberObject.extend(Validations)); + test('shallow isAsync test', function(assert) { + let Validations = buildValidations({ + firstName: validator('inline', { + validate() { + return new EmberPromise(resolve => { + resolve(true); + }); + } + }) + }); - assert.equal(obj.get('validations.attrs.firstName.isAsync'), true); - assert.equal(obj.get('validations.attrs.firstName.isValidating'), true); + let obj = setupObject(this, EmberObject.extend(Validations)); - return obj.validate().then(({ model }) => { - assert.equal(model.get('validations.isValid'), true); - assert.equal(model.get('validations.isValidating'), false); - }); -}); + assert.equal(obj.get('validations.attrs.firstName.isAsync'), true); + assert.equal(obj.get('validations.attrs.firstName.isValidating'), true); -test('default options', function(assert) { - let Validations = buildValidations({ - firstName: { - description: 'Test field', - validators: [ - validator('inline', { validate: Validators.presence }), - validator('inline', { validate: () => false }) - ] - } - }); - let object = setupObject(this, EmberObject.extend(Validations), { - firstName: '' + return obj.validate().then(({ model }) => { + assert.equal(model.get('validations.isValid'), true); + assert.equal(model.get('validations.isValidating'), false); + }); }); - let rules = A(object.get('validations._validationRules.firstName')); - assert.equal(rules.isAny('defaultOptions', undefined), false); - assert.equal(rules[0].defaultOptions.description, 'Test field'); -}); -test('global options', function(assert) { - this.register('validator:length', LengthValidator); - - let Validations = buildValidations( - { + test('default options', function(assert) { + let Validations = buildValidations({ firstName: { description: 'Test field', - validators: [validator('length', { min: 1, max: 5 })] + validators: [ + validator('inline', { validate: Validators.presence }), + validator('inline', { validate: () => false }) + ] } - }, - { - message: 'Global error message', - description: 'Default field', - max: 10 - } - ); - - let object = setupObject(this, EmberObject.extend(Validations), { - firstName: '' + }); + let object = setupObject(this, EmberObject.extend(Validations), { + firstName: '' + }); + let rules = A(object.get('validations._validationRules.firstName')); + assert.equal(rules.isAny('defaultOptions', undefined), false); + assert.equal(rules[0].defaultOptions.description, 'Test field'); }); - // Global options present in rules - let rules = A(object.get('validations._validationRules.firstName')); - assert.equal(rules.isAny('globalOptions', undefined), false); - assert.equal(rules[0].globalOptions.max, 10); - - assert.ok(object.get('validations.attrs.firstName.isInvalid')); - - let v = object.get('validations._validators.firstName.0'); - assert.deepEqual( - v.get('options').getProperties(['message', 'description', 'min', 'max']), - { - message: 'Global error message', - description: 'Test field', - min: 1, - max: 5 - } - ); -}); + test('global options', function(assert) { + this.owner.register('validator:length', LengthValidator); -test('custom messages object', function(assert) { - this.register('validator:messages', DefaultMessages); - let Validations = buildValidations({ - firstName: validator('inline', { - validate(value) { - return this.createErrorMessage('test', value); + let Validations = buildValidations( + { + firstName: { + description: 'Test field', + validators: [validator('length', { min: 1, max: 5 })] + } + }, + { + message: 'Global error message', + description: 'Default field', + max: 10 } - }) + ); + + let object = setupObject(this, EmberObject.extend(Validations), { + firstName: '' + }); + + // Global options present in rules + let rules = A(object.get('validations._validationRules.firstName')); + assert.equal(rules.isAny('globalOptions', undefined), false); + assert.equal(rules[0].globalOptions.max, 10); + + assert.ok(object.get('validations.attrs.firstName.isInvalid')); + + let v = object.get('validations._validators.firstName.0'); + assert.deepEqual( + v.get('options').getProperties(['message', 'description', 'min', 'max']), + { + message: 'Global error message', + description: 'Test field', + min: 1, + max: 5 + } + ); }); - let object = setupObject(this, EmberObject.extend(Validations)); + test('custom messages object', function(assert) { + this.owner.register('validator:messages', DefaultMessages); + let Validations = buildValidations({ + firstName: validator('inline', { + validate(value) { + return this.createErrorMessage('test', value); + } + }) + }); - assert.equal(object.get('validations.attrs.firstName.isValid'), false); - assert.equal(object.get('validations.attrs.firstName.isValidating'), false); - assert.equal( - object.get('validations.attrs.firstName.message'), - 'Test error message' - ); -}); + let object = setupObject(this, EmberObject.extend(Validations)); -test('null message object', function(assert) { - this.register('validator:messages', DefaultMessages); - let Validations = buildValidations({ - firstName: validator('presence', { - presence: true, - message: null - }) + assert.equal(object.get('validations.attrs.firstName.isValid'), false); + assert.equal(object.get('validations.attrs.firstName.isValidating'), false); + assert.equal( + object.get('validations.attrs.firstName.message'), + 'Test error message' + ); }); - let object = setupObject(this, EmberObject.extend(Validations)); + test('null message object', function(assert) { + this.owner.register('validator:messages', DefaultMessages); + let Validations = buildValidations({ + firstName: validator('presence', { + presence: true, + message: null + }) + }); - assert.equal( - object.get('validations.attrs.firstName.message'), - "This field can't be blank" - ); -}); + let object = setupObject(this, EmberObject.extend(Validations)); -test('debounced validations', function(assert) { - let done = assert.async(); - let initSetup = true; - let Validations = buildValidations({ - firstName: validator('inline', { validate: Validators.presence }), - lastName: validator('inline', { - validate: Validators.presence, - debounce: computed(function() { - return initSetup ? 0 : 500; // Do not debounce on initial object creation - }).volatile() - }) + assert.equal( + object.get('validations.attrs.firstName.message'), + "This field can't be blank" + ); }); - let object = setupObject(this, EmberObject.extend(Validations)); - - assert.equal( - object.get('validations.isValid'), - false, - 'isValid was expected to be FALSE' - ); - assert.equal( - object.get('validations.isValidating'), - false, - 'isValidating was expected to be TRUE' - ); - assert.equal( - object.get('validations.isTruelyValid'), - false, - 'isTruelyValid was expected to be FALSE' - ); - assert.equal( - object.get('validations.isTruelyInvalid'), - true, - 'isTruelyInvalid was expected to be TRUE' - ); - - assert.equal(object.get('validations.attrs.lastName.isValid'), false); - assert.equal(object.get('validations.attrs.lastName.isValidating'), false); - assert.equal( - object.get('validations.attrs.lastName.message'), - 'lastName should be present' - ); - - initSetup = false; - object.set('lastName', 'Golan'); - assert.equal(object.get('validations.attrs.lastName.isValidating'), true); - - run.later(() => { - assert.equal(object.get('validations.attrs.lastName.isValid'), true); + + test('debounced validations', function(assert) { + let done = assert.async(); + let initSetup = true; + let Validations = buildValidations({ + firstName: validator('inline', { validate: Validators.presence }), + lastName: validator('inline', { + validate: Validators.presence, + debounce: computed(function() { + return initSetup ? 0 : 500; // Do not debounce on initial object creation + }).volatile() + }) + }); + let object = setupObject(this, EmberObject.extend(Validations)); + + assert.equal( + object.get('validations.isValid'), + false, + 'isValid was expected to be FALSE' + ); + assert.equal( + object.get('validations.isValidating'), + false, + 'isValidating was expected to be TRUE' + ); + assert.equal( + object.get('validations.isTruelyValid'), + false, + 'isTruelyValid was expected to be FALSE' + ); + assert.equal( + object.get('validations.isTruelyInvalid'), + true, + 'isTruelyInvalid was expected to be TRUE' + ); + + assert.equal(object.get('validations.attrs.lastName.isValid'), false); assert.equal(object.get('validations.attrs.lastName.isValidating'), false); - assert.equal(object.get('validations.attrs.lastName.message'), null); - done(); - }, 500); -}); + assert.equal( + object.get('validations.attrs.lastName.message'), + 'lastName should be present' + ); -test('debounced validator should only be called once', function(assert) { - let count = 0; + initSetup = false; + object.set('lastName', 'Golan'); + assert.equal(object.get('validations.attrs.lastName.isValidating'), true); - let done = assert.async(); - let Validations = buildValidations({ - firstName: validator('inline', { - validate: () => count++, - debounce: 500 - }) + run.later(() => { + assert.equal(object.get('validations.attrs.lastName.isValid'), true); + assert.equal( + object.get('validations.attrs.lastName.isValidating'), + false + ); + assert.equal(object.get('validations.attrs.lastName.message'), null); + done(); + }, 500); }); - let object = setupObject(this, EmberObject.extend(Validations)); - - object.set('firstName', 'O'); - object.get('validations.attrs.firstName.isValid'); + test('debounced validator should only be called once', function(assert) { + let count = 0; - object.set('firstName', 'Off'); - object.get('validations.attrs.firstName.isValid'); + let done = assert.async(); + let Validations = buildValidations({ + firstName: validator('inline', { + validate: () => count++, + debounce: 500 + }) + }); - object.set('firstName', 'Offir'); - object.get('validations.attrs.firstName.isValid'); + let object = setupObject(this, EmberObject.extend(Validations)); - run.later(() => { - assert.equal(count, 1); - done(); - }, 500); -}); + object.set('firstName', 'O'); + object.get('validations.attrs.firstName.isValid'); -test('debounced validations should cleanup on object destroy', function(assert) { - let done = assert.async(); - let initSetup = true; - - let debouncedValidator = validator('inline', { - debounce: computed(function() { - return initSetup ? 0 : 500; - }).volatile(), - validate(value, options, model, attr) { - model.set('foo', 'bar'); - return Validators.presence(value, options, model, attr); - } - }); + object.set('firstName', 'Off'); + object.get('validations.attrs.firstName.isValid'); - let Validations = buildValidations({ - firstName: validator('inline', { validate: Validators.presence }), - lastName: debouncedValidator, - 'details.url': debouncedValidator - }); - let object = setupObject(this, EmberObject.extend(Validations), { - details: {} - }); + object.set('firstName', 'Offir'); + object.get('validations.attrs.firstName.isValid'); - assert.equal( - object.get('validations.isValid'), - false, - 'isValid was expected to be FALSE' - ); - assert.equal( - object.get('validations.isValidating'), - false, - 'isValidating was expected to be TRUE' - ); - assert.equal( - object.get('validations.isTruelyValid'), - false, - 'isTruelyValid was expected to be FALSE' - ); - assert.equal( - object.get('validations.isTruelyInvalid'), - true, - 'isTruelyInvalid was expected to be TRUE' - ); - - assert.equal(object.get('validations.attrs.lastName.isValid'), false); - assert.equal(object.get('validations.attrs.lastName.isValidating'), false); - assert.equal( - object.get('validations.attrs.lastName.message'), - 'lastName should be present' - ); - - initSetup = false; - object.setProperties({ - lastName: 'Golan', - 'details.url': 'github.com' - }); - assert.equal(object.get('validations.attrs.lastName.isValidating'), true); - assert.equal(object.get('validations.attrs.details.url.isValidating'), true); - - run.later(() => { - try { - object.destroy(); - assert.ok(true, 'Object destroy was clean'); - } catch (e) { - /* noop */ - } run.later(() => { + assert.equal(count, 1); done(); - }, 400); - }, 200); -}); - -test('disabled validations - simple', function(assert) { - let Validations = buildValidations({ - firstName: validator('inline', { validate: Validators.presence }), - lastName: validator('inline', { - validate: Validators.presence, - disabled: true - }) + }, 500); }); - let object = setupObject(this, EmberObject.extend(Validations)); - - assert.equal( - object.get('validations.isValid'), - false, - 'isValid was expected to be FALSE' - ); - assert.equal( - object.get('validations.isValidating'), - false, - 'isValidating was expected to be TRUE' - ); - assert.equal( - object.get('validations.isTruelyValid'), - false, - 'isTruelyValid was expected to be FALSE' - ); - assert.equal( - object.get('validations.isTruelyInvalid'), - true, - 'isTruelyInvalid was expected to be TRUE' - ); - - assert.equal(object.get('validations.attrs.lastName.isValid'), true); - assert.equal(object.get('validations.attrs.firstName.isValid'), false); - - object.set('firstName', 'Offir'); - - assert.equal(object.get('validations.isValid'), true); -}); -test('disabled validations - cp with dependent key', function(assert) { - let Validations = buildValidations({ - firstName: validator('inline', { validate: Validators.presence }), - lastName: validator('inline', { - validate: Validators.presence, - disabled: not('model.validateLastName') - }) - }); - let object = setupObject( - this, - EmberObject.extend(Validations, { - firstName: 'Offir', - validateLastName: true - }) - ); - - assert.equal( - object.get('validations.isValid'), - false, - 'isValid was expected to be FALSE' - ); - assert.equal( - object.get('validations.isValidating'), - false, - 'isValidating was expected to be TRUE' - ); - assert.equal( - object.get('validations.isTruelyValid'), - false, - 'isTruelyValid was expected to be FALSE' - ); - assert.equal( - object.get('validations.isTruelyInvalid'), - true, - 'isTruelyInvalid was expected to be TRUE' - ); - - assert.equal(object.get('validations.attrs.lastName.isValid'), false); - assert.equal(object.get('validations.attrs.firstName.isValid'), true); - - object.set('validateLastName', false); - - assert.equal(object.get('validations.attrs.lastName.isValid'), true); - assert.equal(object.get('validations.isValid'), true); -}); + test('debounced validations should cleanup on object destroy', function(assert) { + let done = assert.async(); + let initSetup = true; -test('attribute validation result options hash', function(assert) { - this.register('validator:length', LengthValidator); - this.register('validator:presence', PresenceValidator); + let debouncedValidator = validator('inline', { + debounce: computed(function() { + return initSetup ? 0 : 500; + }).volatile(), + validate(value, options, model, attr) { + model.set('foo', 'bar'); + return Validators.presence(value, options, model, attr); + } + }); - let Validations = buildValidations({ - firstName: { - description: 'First Name', - validators: [ - validator('inline', { validate: Validators.presence }), - validator('inline', { validate: Validators.presence, presence: true }), - validator('presence', true), - validator('length', { - min: 1, - max: 5 - }) - ] - } - }); - let object = setupObject(this, EmberObject.extend(Validations, { max: 5 })); - let options = object.get('validations.attrs.firstName.options'); - - assert.ok(options); - assert.deepEqual( - Object.keys(options).sort(), - ['presence', 'length', 'inline'].sort() - ); - assert.ok(isArray(options['inline']) && options['inline'].length === 2); - assert.ok(options.presence.presence); - assert.equal(options.length.min, 1); - assert.ok(options['inline'][1].presence); - - // Default options built into option objects - assert.equal(options.length.description, 'First Name'); - assert.equal(options.presence.description, 'First Name'); - assert.equal(options['inline'][0].description, 'First Name'); -}); + let Validations = buildValidations({ + firstName: validator('inline', { validate: Validators.presence }), + lastName: debouncedValidator, + 'details.url': debouncedValidator + }); + let object = setupObject(this, EmberObject.extend(Validations), { + details: {} + }); -test('attribute validation result options hash with cps', function(assert) { - this.register('validator:length', LengthValidator); + assert.equal( + object.get('validations.isValid'), + false, + 'isValid was expected to be FALSE' + ); + assert.equal( + object.get('validations.isValidating'), + false, + 'isValidating was expected to be TRUE' + ); + assert.equal( + object.get('validations.isTruelyValid'), + false, + 'isTruelyValid was expected to be FALSE' + ); + assert.equal( + object.get('validations.isTruelyInvalid'), + true, + 'isTruelyInvalid was expected to be TRUE' + ); + + assert.equal(object.get('validations.attrs.lastName.isValid'), false); + assert.equal(object.get('validations.attrs.lastName.isValidating'), false); + assert.equal( + object.get('validations.attrs.lastName.message'), + 'lastName should be present' + ); + + initSetup = false; + object.setProperties({ + lastName: 'Golan', + 'details.url': 'github.com' + }); + assert.equal(object.get('validations.attrs.lastName.isValidating'), true); + assert.equal( + object.get('validations.attrs.details.url.isValidating'), + true + ); - let Validations = buildValidations({ - firstName: { - validators: [ - validator('length', { - min: 1, - max: readOnly('model.max') - }) - ] - } + run.later(() => { + try { + object.destroy(); + assert.ok(true, 'Object destroy was clean'); + } catch (e) { + /* noop */ + } + run.later(() => { + done(); + }, 400); + }, 200); }); - let object = setupObject(this, EmberObject.extend(Validations, { max: 5 })); - let options = object.get('validations.attrs.firstName.options'); - assert.equal(options.length.max, 5); - run(() => object.set('max', 3)); + test('disabled validations - simple', function(assert) { + let Validations = buildValidations({ + firstName: validator('inline', { validate: Validators.presence }), + lastName: validator('inline', { + validate: Validators.presence, + disabled: true + }) + }); + let object = setupObject(this, EmberObject.extend(Validations)); + + assert.equal( + object.get('validations.isValid'), + false, + 'isValid was expected to be FALSE' + ); + assert.equal( + object.get('validations.isValidating'), + false, + 'isValidating was expected to be TRUE' + ); + assert.equal( + object.get('validations.isTruelyValid'), + false, + 'isTruelyValid was expected to be FALSE' + ); + assert.equal( + object.get('validations.isTruelyInvalid'), + true, + 'isTruelyInvalid was expected to be TRUE' + ); - options = object.get('validations.attrs.firstName.options'); - assert.equal(options.length.max, 3); -}); + assert.equal(object.get('validations.attrs.lastName.isValid'), true); + assert.equal(object.get('validations.attrs.firstName.isValid'), false); -test('validations persist with inheritance', function(assert) { - let Parent = EmberObject.extend( - buildValidations({ - firstName: validator('inline', { validate: Validators.presence }), - lastName: validator('inline', { validate: Validators.presence }) - }) - ); - - let Child = Parent.extend( - buildValidations({ - middleName: validator('inline', { validate: Validators.presence }), - dob: validator('inline', { validate: Validators.presence }) - }) - ); - - let child = setupObject(this, Child); - - child.validateSync(); - - assert.equal(child.get('validations.errors.length'), 4); - assert.equal(child.get('validations.isValid'), false); - assert.deepEqual( - child.get('validations.validatableAttributes').sort(), - ['firstName', 'lastName', 'middleName', 'dob'].sort() - ); - - child.setProperties({ - middleName: 'John', - dob: '10/22/16' + object.set('firstName', 'Offir'); + + assert.equal(object.get('validations.isValid'), true); }); - assert.equal(child.get('validations.errors.length'), 2); + test('disabled validations - cp with dependent key', function(assert) { + let Validations = buildValidations({ + firstName: validator('inline', { validate: Validators.presence }), + lastName: validator('inline', { + validate: Validators.presence, + disabled: not('model.validateLastName') + }) + }); + let object = setupObject( + this, + EmberObject.extend(Validations, { + firstName: 'Offir', + validateLastName: true + }) + ); + + assert.equal( + object.get('validations.isValid'), + false, + 'isValid was expected to be FALSE' + ); + assert.equal( + object.get('validations.isValidating'), + false, + 'isValidating was expected to be TRUE' + ); + assert.equal( + object.get('validations.isTruelyValid'), + false, + 'isTruelyValid was expected to be FALSE' + ); + assert.equal( + object.get('validations.isTruelyInvalid'), + true, + 'isTruelyInvalid was expected to be TRUE' + ); + + assert.equal(object.get('validations.attrs.lastName.isValid'), false); + assert.equal(object.get('validations.attrs.firstName.isValid'), true); + + object.set('validateLastName', false); - child.setProperties({ - firstName: 'Joe', - lastName: 'Jenkins' + assert.equal(object.get('validations.attrs.lastName.isValid'), true); + assert.equal(object.get('validations.isValid'), true); }); - assert.equal(child.get('validations.isValid'), true); - assert.equal(child.get('validations.errors.length'), 0); -}); + test('attribute validation result options hash', function(assert) { + this.owner.register('validator:length', LengthValidator); + this.owner.register('validator:presence', PresenceValidator); -test('validations persist with deep inheritance', function(assert) { - let Parent = EmberObject.extend( - buildValidations({ - firstName: validator('inline', { validate: Validators.presence }), - lastName: validator('inline', { validate: Validators.presence }) - }) - ); - - let Child = Parent.extend( - buildValidations({ - middleName: validator('inline', { validate: Validators.presence }), - dob: validator('inline', { validate: Validators.presence }) - }) - ); - - let Baby = Child.extend( - buildValidations({ - diaper: validator('inline', { validate: Validators.presence }), - favParent: validator('inline', { validate: Validators.presence }) - }) - ); - - let baby = setupObject(this, Baby); - - baby.validateSync(); - - assert.equal(baby.get('validations.errors.length'), 6); - assert.equal(baby.get('validations.isValid'), false); - assert.deepEqual( - baby.get('validations.validatableAttributes').sort(), - ['firstName', 'lastName', 'middleName', 'dob', 'diaper', 'favParent'].sort() - ); - - baby.setProperties({ - middleName: 'John', - dob: '10/22/16' + let Validations = buildValidations({ + firstName: { + description: 'First Name', + validators: [ + validator('inline', { validate: Validators.presence }), + validator('inline', { + validate: Validators.presence, + presence: true + }), + validator('presence', true), + validator('length', { + min: 1, + max: 5 + }) + ] + } + }); + let object = setupObject(this, EmberObject.extend(Validations, { max: 5 })); + let options = object.get('validations.attrs.firstName.options'); + + assert.ok(options); + assert.deepEqual( + Object.keys(options).sort(), + ['presence', 'length', 'inline'].sort() + ); + assert.ok(isArray(options['inline']) && options['inline'].length === 2); + assert.ok(options.presence.presence); + assert.equal(options.length.min, 1); + assert.ok(options['inline'][1].presence); + + // Default options built into option objects + assert.equal(options.length.description, 'First Name'); + assert.equal(options.presence.description, 'First Name'); + assert.equal(options['inline'][0].description, 'First Name'); }); - assert.equal(baby.get('validations.errors.length'), 4); + test('attribute validation result options hash with cps', function(assert) { + this.owner.register('validator:length', LengthValidator); - baby.setProperties({ - firstName: 'Joe', - lastName: 'Jenkins' - }); + let Validations = buildValidations({ + firstName: { + validators: [ + validator('length', { + min: 1, + max: readOnly('model.max') + }) + ] + } + }); + let object = setupObject(this, EmberObject.extend(Validations, { max: 5 })); + let options = object.get('validations.attrs.firstName.options'); + assert.equal(options.length.max, 5); - assert.equal(baby.get('validations.errors.length'), 2); + run(() => object.set('max', 3)); - baby.setProperties({ - diaper: 'soiled', - favParent: 'mom' + options = object.get('validations.attrs.firstName.options'); + assert.equal(options.length.max, 3); }); - assert.equal(baby.get('validations.isValid'), true); - assert.equal(baby.get('validations.errors.length'), 0); -}); + test('validations persist with inheritance', function(assert) { + let Parent = EmberObject.extend( + buildValidations({ + firstName: validator('inline', { validate: Validators.presence }), + lastName: validator('inline', { validate: Validators.presence }) + }) + ); -test('nested keys - simple', function(assert) { - let Validations = buildValidations({ - 'user.firstName': validator('inline', { validate: Validators.presence }), - 'user.lastName': validator('inline', { validate: Validators.presence }) - }); - let object = setupObject(this, EmberObject.extend(Validations), { - user: {} - }); + let Child = Parent.extend( + buildValidations({ + middleName: validator('inline', { validate: Validators.presence }), + dob: validator('inline', { validate: Validators.presence }) + }) + ); - assert.equal(object.get('validations.attrs.user.firstName.isValid'), false); - assert.equal(object.get('validations.attrs.user.lastName.isValid'), false); - assert.equal(object.get('validations.isValid'), false); + let child = setupObject(this, Child); - object.set('user.firstName', 'Offir'); + child.validateSync(); - assert.equal(object.get('validations.attrs.user.firstName.isValid'), true); - assert.equal(object.get('validations.isValid'), false); + assert.equal(child.get('validations.errors.length'), 4); + assert.equal(child.get('validations.isValid'), false); + assert.deepEqual( + child.get('validations.validatableAttributes').sort(), + ['firstName', 'lastName', 'middleName', 'dob'].sort() + ); - object.set('user.lastName', 'Golan'); + child.setProperties({ + middleName: 'John', + dob: '10/22/16' + }); - assert.equal(object.get('validations.attrs.user.lastName.isValid'), true); - assert.equal(object.get('validations.isValid'), true); -}); + assert.equal(child.get('validations.errors.length'), 2); -test('nested keys - complex', function(assert) { - let Validations = buildValidations({ - firstName: validator('inline', { validate: Validators.presence }), - 'user.foo.bar.baz': validator('inline', { validate: Validators.presence }), - 'user.foo.boop': validator('inline', { validate: Validators.presence }) - }); - let object = setupObject(this, EmberObject.extend(Validations)); + child.setProperties({ + firstName: 'Joe', + lastName: 'Jenkins' + }); - assert.equal(object.get('validations.attrs.firstName.isValid'), false); - assert.equal(object.get('validations.attrs.user.foo.bar.baz.isValid'), false); - assert.equal(object.get('validations.attrs.user.foo.boop.isValid'), false); - assert.equal(object.get('validations.isValid'), false); + assert.equal(child.get('validations.isValid'), true); + assert.equal(child.get('validations.errors.length'), 0); + }); - object.set('user', { foo: { bar: {} } }); + test('validations persist with deep inheritance', function(assert) { + let Parent = EmberObject.extend( + buildValidations({ + firstName: validator('inline', { validate: Validators.presence }), + lastName: validator('inline', { validate: Validators.presence }) + }) + ); - assert.equal(object.get('validations.attrs.firstName.isValid'), false); - assert.equal(object.get('validations.attrs.user.foo.bar.baz.isValid'), false); - assert.equal(object.get('validations.attrs.user.foo.boop.isValid'), false); - assert.equal(object.get('validations.isValid'), false); + let Child = Parent.extend( + buildValidations({ + middleName: validator('inline', { validate: Validators.presence }), + dob: validator('inline', { validate: Validators.presence }) + }) + ); - object.set('firstName', 'Offir'); - object.set('user.foo.bar.baz', 'blah'); - object.set('user.foo.boop', 'blah'); + let Baby = Child.extend( + buildValidations({ + diaper: validator('inline', { validate: Validators.presence }), + favParent: validator('inline', { validate: Validators.presence }) + }) + ); + + let baby = setupObject(this, Baby); + + baby.validateSync(); + + assert.equal(baby.get('validations.errors.length'), 6); + assert.equal(baby.get('validations.isValid'), false); + assert.deepEqual( + baby.get('validations.validatableAttributes').sort(), + [ + 'firstName', + 'lastName', + 'middleName', + 'dob', + 'diaper', + 'favParent' + ].sort() + ); + + baby.setProperties({ + middleName: 'John', + dob: '10/22/16' + }); - assert.equal(object.get('validations.attrs.firstName.isValid'), true); - assert.equal(object.get('validations.attrs.user.foo.bar.baz.isValid'), true); - assert.equal(object.get('validations.attrs.user.foo.boop.isValid'), true); + assert.equal(baby.get('validations.errors.length'), 4); - assert.ok(object.get(`validations.attrs.${ATTRS_MODEL}`)); - assert.ok(object.get(`validations.attrs.user.foo.bar.${ATTRS_MODEL}`)); - assert.ok(object.get(`validations.attrs.user.foo.${ATTRS_MODEL}`)); + baby.setProperties({ + firstName: 'Joe', + lastName: 'Jenkins' + }); - assert.equal(object.get('validations.isValid'), true); + assert.equal(baby.get('validations.errors.length'), 2); - run(() => object.destroy()); + baby.setProperties({ + diaper: 'soiled', + favParent: 'mom' + }); - assert.notOk(object.get(`validations.attrs.${ATTRS_MODEL}`)); - assert.notOk(object.get(`validations.attrs.user.foo.bar.${ATTRS_MODEL}`)); - assert.notOk(object.get(`validations.attrs.user.foo.${ATTRS_MODEL}`)); -}); + assert.equal(baby.get('validations.isValid'), true); + assert.equal(baby.get('validations.errors.length'), 0); + }); -test('nested keys - inheritance', function(assert) { - let Parent = EmberObject.extend( - buildValidations({ - firstName: validator('inline', { validate: Validators.presence }), + test('nested keys - simple', function(assert) { + let Validations = buildValidations({ 'user.firstName': validator('inline', { validate: Validators.presence }), - 'user.middleName': validator('inline', { validate: Validators.presence }) - }) - ); - - let Child = Parent.extend( - buildValidations({ - 'user.lastName': validator('inline', { validate: Validators.presence }), - 'user.middleName': validator('inline', { - validate() { - return 'Middle name invalid'; - } - }) - }) - ); + 'user.lastName': validator('inline', { validate: Validators.presence }) + }); + let object = setupObject(this, EmberObject.extend(Validations), { + user: {} + }); - let child = setupObject(this, Child); + assert.equal(object.get('validations.attrs.user.firstName.isValid'), false); + assert.equal(object.get('validations.attrs.user.lastName.isValid'), false); + assert.equal(object.get('validations.isValid'), false); - child.validateSync(); + object.set('user.firstName', 'Offir'); - assert.equal(child.get('validations.errors.length'), 4); - assert.equal(child.get('validations.isValid'), false); - assert.deepEqual( - child.get('validations.validatableAttributes').sort(), - ['firstName', 'user.firstName', 'user.middleName', 'user.lastName'].sort() - ); + assert.equal(object.get('validations.attrs.user.firstName.isValid'), true); + assert.equal(object.get('validations.isValid'), false); - child.setProperties({ - user: { - firstName: 'Offir', - middleName: 'David', - lastName: 'Golan' - } - }); + object.set('user.lastName', 'Golan'); - assert.equal(child.get('validations.errors.length'), 2); - assert.equal( - child.get('validations.attrs.user.middleName.message'), - 'Middle name invalid' - ); + assert.equal(object.get('validations.attrs.user.lastName.isValid'), true); + assert.equal(object.get('validations.isValid'), true); + }); - child.setProperties({ - firstName: 'John' + test('nested keys - complex', function(assert) { + let Validations = buildValidations({ + firstName: validator('inline', { validate: Validators.presence }), + 'user.foo.bar.baz': validator('inline', { + validate: Validators.presence + }), + 'user.foo.boop': validator('inline', { validate: Validators.presence }) + }); + let object = setupObject(this, EmberObject.extend(Validations)); + + assert.equal(object.get('validations.attrs.firstName.isValid'), false); + assert.equal( + object.get('validations.attrs.user.foo.bar.baz.isValid'), + false + ); + assert.equal(object.get('validations.attrs.user.foo.boop.isValid'), false); + assert.equal(object.get('validations.isValid'), false); + + object.set('user', { foo: { bar: {} } }); + + assert.equal(object.get('validations.attrs.firstName.isValid'), false); + assert.equal( + object.get('validations.attrs.user.foo.bar.baz.isValid'), + false + ); + assert.equal(object.get('validations.attrs.user.foo.boop.isValid'), false); + assert.equal(object.get('validations.isValid'), false); + + object.set('firstName', 'Offir'); + object.set('user.foo.bar.baz', 'blah'); + object.set('user.foo.boop', 'blah'); + + assert.equal(object.get('validations.attrs.firstName.isValid'), true); + assert.equal( + object.get('validations.attrs.user.foo.bar.baz.isValid'), + true + ); + assert.equal(object.get('validations.attrs.user.foo.boop.isValid'), true); + + assert.ok(object.get(`validations.attrs.${ATTRS_MODEL}`)); + assert.ok(object.get(`validations.attrs.user.foo.bar.${ATTRS_MODEL}`)); + assert.ok(object.get(`validations.attrs.user.foo.${ATTRS_MODEL}`)); + + assert.equal(object.get('validations.isValid'), true); + + run(() => object.destroy()); + + assert.notOk(object.get(`validations.attrs.${ATTRS_MODEL}`)); + assert.notOk(object.get(`validations.attrs.user.foo.bar.${ATTRS_MODEL}`)); + assert.notOk(object.get(`validations.attrs.user.foo.${ATTRS_MODEL}`)); }); - assert.equal(child.get('validations.isValid'), false); - assert.equal(child.get('validations.errors.length'), 1); -}); + test('nested keys - inheritance', function(assert) { + let Parent = EmberObject.extend( + buildValidations({ + firstName: validator('inline', { validate: Validators.presence }), + 'user.firstName': validator('inline', { + validate: Validators.presence + }), + 'user.middleName': validator('inline', { + validate: Validators.presence + }) + }) + ); -test('call super in validations class with no super property', function(assert) { - // see https://github.com/offirgolan/ember-cp-validations/issues/149 - assert.expect(1); + let Child = Parent.extend( + buildValidations({ + 'user.lastName': validator('inline', { validate: Validators.presence }), + 'user.middleName': validator('inline', { + validate() { + return 'Middle name invalid'; + } + }) + }) + ); - let Validations = buildValidations({ - firstName: validator('inline', { validate: Validators.presence }) - }); + let child = setupObject(this, Child); + + child.validateSync(); - let mixin = Mixin.create({ - actions: { - foo() { - // The issue is that __validationsClass__ is calling super but since - // this is no __validationsClass__ method on the super, it is wrapped - // with the closest context which is the 'foo' action - assert.ok(false); // should not reach here + assert.equal(child.get('validations.errors.length'), 4); + assert.equal(child.get('validations.isValid'), false); + assert.deepEqual( + child.get('validations.validatableAttributes').sort(), + ['firstName', 'user.firstName', 'user.middleName', 'user.lastName'].sort() + ); + + child.setProperties({ + user: { + firstName: 'Offir', + middleName: 'David', + lastName: 'Golan' } - } + }); + + assert.equal(child.get('validations.errors.length'), 2); + assert.equal( + child.get('validations.attrs.user.middleName.message'), + 'Middle name invalid' + ); + + child.setProperties({ + firstName: 'John' + }); + + assert.equal(child.get('validations.isValid'), false); + assert.equal(child.get('validations.errors.length'), 1); }); - let controller = setupObject( - this, - Controller.extend(Validations, mixin, { + test('call super in validations class with no super property', function(assert) { + // see https://github.com/offirgolan/ember-cp-validations/issues/149 + assert.expect(1); + + let Validations = buildValidations({ + firstName: validator('inline', { validate: Validators.presence }) + }); + + let mixin = Mixin.create({ actions: { foo() { - assert.ok(true); - /* eslint-disable */ - let validations = this.get('validations'); - /* eslint-enable */ + // The issue is that __validationsClass__ is calling super but since + // this is no __validationsClass__ method on the super, it is wrapped + // with the closest context which is the 'foo' action + assert.ok(false); // should not reach here } } - }) - ); + }); - controller.send('foo'); -}); + let controller = setupObject( + this, + Controller.extend(Validations, mixin, { + actions: { + foo() { + assert.ok(true); + /* eslint-disable */ + let validations = this.get('validations'); + /* eslint-enable */ + } + } + }) + ); -test('multiple mixins', function(assert) { - let Validations1 = buildValidations({ - firstName: validator('inline', { validate: Validators.presence }) + controller.send('foo'); }); - let Validations2 = buildValidations({ - middleName: validator('inline', { validate: Validators.presence }) - }); + test('multiple mixins', function(assert) { + let Validations1 = buildValidations({ + firstName: validator('inline', { validate: Validators.presence }) + }); - let Validations3 = buildValidations({ - lastName: validator('inline', { validate: Validators.presence }) - }); + let Validations2 = buildValidations({ + middleName: validator('inline', { validate: Validators.presence }) + }); - let object = setupObject( - this, - EmberObject.extend(Validations1, Validations2, Validations3) - ); + let Validations3 = buildValidations({ + lastName: validator('inline', { validate: Validators.presence }) + }); - assert.deepEqual( - object.get('validations.validatableAttributes').sort(), - ['firstName', 'middleName', 'lastName'].sort() - ); - assert.equal(object.get('validations.attrs.firstName.isValid'), false); - assert.equal(object.get('validations.attrs.lastName.isValid'), false); - assert.equal(object.get('validations.isValid'), false); + let object = setupObject( + this, + EmberObject.extend(Validations1, Validations2, Validations3) + ); - object.set('firstName', 'Offir'); + assert.deepEqual( + object.get('validations.validatableAttributes').sort(), + ['firstName', 'middleName', 'lastName'].sort() + ); + assert.equal(object.get('validations.attrs.firstName.isValid'), false); + assert.equal(object.get('validations.attrs.lastName.isValid'), false); + assert.equal(object.get('validations.isValid'), false); - assert.equal(object.get('validations.attrs.firstName.isValid'), true); - assert.equal(object.get('validations.isValid'), false); + object.set('firstName', 'Offir'); - object.set('middleName', 'David'); + assert.equal(object.get('validations.attrs.firstName.isValid'), true); + assert.equal(object.get('validations.isValid'), false); - assert.equal(object.get('validations.attrs.middleName.isValid'), true); - assert.equal(object.get('validations.isValid'), false); + object.set('middleName', 'David'); - object.set('lastName', 'Golan'); + assert.equal(object.get('validations.attrs.middleName.isValid'), true); + assert.equal(object.get('validations.isValid'), false); - assert.equal(object.get('validations.attrs.lastName.isValid'), true); - assert.equal(object.get('validations.isValid'), true); -}); + object.set('lastName', 'Golan'); -test('validateAttribute - sync validations', function(assert) { - let Validations = buildValidations({ - firstName: [ - validator('inline', { validate: Validators.presence }), - validator('inline', { validate: () => true }) - ] - }); - let object = setupObject(this, EmberObject.extend(Validations), { - firstName: 'Offir' + assert.equal(object.get('validations.attrs.lastName.isValid'), true); + assert.equal(object.get('validations.isValid'), true); }); - return object - .validateAttribute('firstName', undefined) - .then(({ validations, model }) => { - assert.equal(model.get('validations.isValid'), true); - assert.equal(validations.get('isValid'), false); - assert.equal(validations.get('isValidating'), false); - assert.equal(validations.get('message'), 'firstName should be present'); + test('validateAttribute - sync validations', function(assert) { + let Validations = buildValidations({ + firstName: [ + validator('inline', { validate: Validators.presence }), + validator('inline', { validate: () => true }) + ] + }); + let object = setupObject(this, EmberObject.extend(Validations), { + firstName: 'Offir' }); -}); -test('validateAttribute - async validations', function(assert) { - let Validations = buildValidations({ - firstName: [ - validator('inline', { - validate: () => EmberPromise.resolve('firstName is invalid') - }), - validator('inline', { - validate: () => EmberPromise.resolve('firstName is really invalid') - }) - ] - }); - let object = setupObject(this, EmberObject.extend(Validations), { - firstName: 'Offir' + return object + .validateAttribute('firstName', undefined) + .then(({ validations, model }) => { + assert.equal(model.get('validations.isValid'), true); + assert.equal(validations.get('isValid'), false); + assert.equal(validations.get('isValidating'), false); + assert.equal(validations.get('message'), 'firstName should be present'); + }); }); - return object - .validateAttribute('firstName', 'foo') - .then(({ validations }) => { - assert.equal(validations.get('isValid'), false); - assert.equal(validations.get('isValidating'), false); - assert.equal(validations.get('message'), 'firstName is invalid'); - }); -}); - -test('warning validators api', function(assert) { - this.register('validator:length', LengthValidator); - this.register('validator:presence', PresenceValidator); - - let Validations = buildValidations({ - password: { - description: 'Password', - validators: [ - validator('presence', { - presence: true, - isWarning: true, - message: '{description} should not be empty' - }), - validator('length', { - min: 4, - isWarning: true, - message: '{description} is weak' + test('validateAttribute - async validations', function(assert) { + let Validations = buildValidations({ + firstName: [ + validator('inline', { + validate: () => EmberPromise.resolve('firstName is invalid') }), - validator('length', { - min: 1, - max: 10 + validator('inline', { + validate: () => EmberPromise.resolve('firstName is really invalid') }) ] - } - }); + }); + let object = setupObject(this, EmberObject.extend(Validations), { + firstName: 'Offir' + }); - let object = setupObject(this, EmberObject.extend(Validations), { - password: '' + return object + .validateAttribute('firstName', 'foo') + .then(({ validations }) => { + assert.equal(validations.get('isValid'), false); + assert.equal(validations.get('isValidating'), false); + assert.equal(validations.get('message'), 'firstName is invalid'); + }); }); - assert.equal(object.get('validations.isValid'), false); - assert.equal(object.get('validations.warnings.length'), 2); - assert.equal( - object.get('validations.warningMessage'), - 'Password should not be empty' - ); - assert.equal( - object.get('validations.message'), - 'Password is too short (minimum is 1 characters)' - ); - - assert.equal(object.get('validations.attrs.password.isValid'), false); - assert.equal(object.get('validations.attrs.password.warnings.length'), 2); - assert.equal( - object.get('validations.attrs.password.warningMessage'), - 'Password should not be empty' - ); - assert.equal( - object.get('validations.attrs.password.message'), - 'Password is too short (minimum is 1 characters)' - ); - - object.set('password', 'wat'); - - assert.equal(object.get('validations.isValid'), true); - assert.equal(object.get('validations.attrs.password.isValid'), true); - assert.equal(object.get('validations.attrs.password.warnings.length'), 1); - assert.equal( - object.get('validations.attrs.password.warningMessage'), - 'Password is weak' - ); -}); + test('warning validators api', function(assert) { + this.owner.register('validator:length', LengthValidator); + this.owner.register('validator:presence', PresenceValidator); -test('computed isWarning option', function(assert) { - this.register('validator:length', LengthValidator); - this.register('validator:presence', PresenceValidator); - - let Validations = buildValidations({ - password: { - description: 'Password', - lazy: false, - validators: [ - validator('presence', { - presence: true, - isWarning: readOnly('model.isWarning'), - message: '{description} should not be empty' - }), - validator('length', { - min: 1, - max: 10 - }) - ] - } + let Validations = buildValidations({ + password: { + description: 'Password', + validators: [ + validator('presence', { + presence: true, + isWarning: true, + message: '{description} should not be empty' + }), + validator('length', { + min: 4, + isWarning: true, + message: '{description} is weak' + }), + validator('length', { + min: 1, + max: 10 + }) + ] + } + }); + + let object = setupObject(this, EmberObject.extend(Validations), { + password: '' + }); + + assert.equal(object.get('validations.isValid'), false); + assert.equal(object.get('validations.warnings.length'), 2); + assert.equal( + object.get('validations.warningMessage'), + 'Password should not be empty' + ); + assert.equal( + object.get('validations.message'), + 'Password is too short (minimum is 1 characters)' + ); + + assert.equal(object.get('validations.attrs.password.isValid'), false); + assert.equal(object.get('validations.attrs.password.warnings.length'), 2); + assert.equal( + object.get('validations.attrs.password.warningMessage'), + 'Password should not be empty' + ); + assert.equal( + object.get('validations.attrs.password.message'), + 'Password is too short (minimum is 1 characters)' + ); + + object.set('password', 'wat'); + + assert.equal(object.get('validations.isValid'), true); + assert.equal(object.get('validations.attrs.password.isValid'), true); + assert.equal(object.get('validations.attrs.password.warnings.length'), 1); + assert.equal( + object.get('validations.attrs.password.warningMessage'), + 'Password is weak' + ); }); - let object = setupObject(this, EmberObject.extend(Validations), { - password: '', - isWarning: false + test('computed isWarning option', function(assert) { + this.owner.register('validator:length', LengthValidator); + this.owner.register('validator:presence', PresenceValidator); + + let Validations = buildValidations({ + password: { + description: 'Password', + lazy: false, + validators: [ + validator('presence', { + presence: true, + isWarning: readOnly('model.isWarning'), + message: '{description} should not be empty' + }), + validator('length', { + min: 1, + max: 10 + }) + ] + } + }); + + let object = setupObject(this, EmberObject.extend(Validations), { + password: '', + isWarning: false + }); + + assert.equal(object.get('validations.isValid'), false); + assert.equal(object.get('validations.warnings.length'), 0); + assert.equal(object.get('validations.errors.length'), 2); + + object.set('isWarning', true); + + assert.equal(object.get('validations.warnings.length'), 1); + assert.equal(object.get('validations.errors.length'), 1); }); - assert.equal(object.get('validations.isValid'), false); - assert.equal(object.get('validations.warnings.length'), 0); - assert.equal(object.get('validations.errors.length'), 2); + test('options CP changes trigger attribute revalidation', function(assert) { + this.owner.register('validator:length', LengthValidator); + + let Validations = buildValidations( + { + firstName: { + description: readOnly('model.description'), + validators: [ + validator('length', { + min: alias('model.minLength') + }) + ] + } + }, + { + disabled: not('model.enabled') + } + ); + + let object = setupObject( + this, + EmberObject.extend(Validations, { + enabled: true, + description: 'First Name', + minLength: 6, + firstName: 'Offir' + }) + ); + + assert.equal( + object.get('validations.isValid'), + false, + 'isValid was expected to be FALSE' + ); + assert.equal( + object.get('validations.isValidating'), + false, + 'isValidating was expected to be FALSE' + ); + assert.equal( + object.get('validations.isTruelyValid'), + false, + 'isTruelyValid was expected to be FALSE' + ); + assert.equal( + object.get('validations.isTruelyInvalid'), + true, + 'isTruelyInvalid was expected to be TRUE' + ); + + assert.equal(object.get('validations.attrs.firstName.isValid'), false); + assert.equal( + object.get('validations.attrs.firstName.message'), + 'First Name is too short (minimum is 6 characters)' + ); + + object.setProperties({ + description: 'Name', + minLength: 10 + }); - object.set('isWarning', true); + assert.equal(object.get('validations.attrs.firstName.isValid'), false); + assert.equal( + object.get('validations.attrs.firstName.message'), + 'Name is too short (minimum is 10 characters)' + ); - assert.equal(object.get('validations.warnings.length'), 1); - assert.equal(object.get('validations.errors.length'), 1); -}); + object.set('enabled', false); -test('options CP changes trigger attribute revalidation', function(assert) { - this.register('validator:length', LengthValidator); + assert.equal(object.get('validations.attrs.firstName.isValid'), true); + assert.equal( + object.get('validations.isValid'), + true, + 'isValid was expected to be FALSE' + ); + }); - let Validations = buildValidations( - { - firstName: { - description: readOnly('model.description'), + test('lazy validators are actually lazy', function(assert) { + this.owner.register('validator:length', LengthValidator); + this.owner.register('validator:presence', PresenceValidator); + + let customValidatorCount = 0; + + let Validations = buildValidations({ + password: { + description: 'Password', validators: [ + validator('presence', true), validator('length', { - min: alias('model.minLength') + min: 5 + }), + validator('inline', { + validate() { + customValidatorCount++; + return 'Password is not valid'; + } }) ] } - }, - { - disabled: not('model.enabled') - } - ); - - let object = setupObject( - this, - EmberObject.extend(Validations, { - enabled: true, - description: 'First Name', - minLength: 6, - firstName: 'Offir' - }) - ); - - assert.equal( - object.get('validations.isValid'), - false, - 'isValid was expected to be FALSE' - ); - assert.equal( - object.get('validations.isValidating'), - false, - 'isValidating was expected to be FALSE' - ); - assert.equal( - object.get('validations.isTruelyValid'), - false, - 'isTruelyValid was expected to be FALSE' - ); - assert.equal( - object.get('validations.isTruelyInvalid'), - true, - 'isTruelyInvalid was expected to be TRUE' - ); - - assert.equal(object.get('validations.attrs.firstName.isValid'), false); - assert.equal( - object.get('validations.attrs.firstName.message'), - 'First Name is too short (minimum is 6 characters)' - ); - - object.setProperties({ - description: 'Name', - minLength: 10 + }); + + let object = setupObject(this, EmberObject.extend(Validations)); + + assert.equal(object.get('validations.attrs.password.isValid'), false); + assert.equal( + object.get('validations.attrs.password.messages.length'), + 1, + 'Only 1 error message should be present' + ); + assert.equal( + object.get('validations.attrs.password.message'), + "Password can't be blank" + ); + + object.set('password', '1234'); + + assert.equal(object.get('validations.attrs.password.isValid'), false); + assert.equal( + object.get('validations.attrs.password.messages.length'), + 1, + 'Only 1 error message should be present' + ); + assert.equal( + object.get('validations.attrs.password.message'), + 'Password is too short (minimum is 5 characters)' + ); + + object.set('password', '12345'); + + assert.equal(object.get('validations.attrs.password.isValid'), false); + assert.equal( + object.get('validations.attrs.password.messages.length'), + 1, + 'Only 1 error message should be present' + ); + assert.equal( + object.get('validations.attrs.password.message'), + 'Password is not valid' + ); + assert.equal(customValidatorCount, 1, 'Last validator only executed once'); }); - assert.equal(object.get('validations.attrs.firstName.isValid'), false); - assert.equal( - object.get('validations.attrs.firstName.message'), - 'Name is too short (minimum is 10 characters)' - ); + test('none lazy validators are actually not lazy', function(assert) { + this.owner.register('validator:length', LengthValidator); + this.owner.register('validator:presence', PresenceValidator); - object.set('enabled', false); + let customValidatorCount = 0; - assert.equal(object.get('validations.attrs.firstName.isValid'), true); - assert.equal( - object.get('validations.isValid'), - true, - 'isValid was expected to be FALSE' - ); -}); + let Validations = buildValidations({ + password: { + description: 'Password', + validators: [ + validator('presence', true), + validator('length', { + min: 5, + lazy: false + }), + validator('inline', { + lazy: false, + validate() { + customValidatorCount++; + return 'Password is not valid'; + } + }) + ] + } + }); -test('lazy validators are actually lazy', function(assert) { - this.register('validator:length', LengthValidator); - this.register('validator:presence', PresenceValidator); + let object = setupObject(this, EmberObject.extend(Validations)); + + assert.equal(object.get('validations.attrs.password.isValid'), false); + assert.equal( + object.get('validations.attrs.password.messages.length'), + 2, + 'Only 2 error message should be present' + ); + assert.equal( + object.get('validations.attrs.password.message'), + "Password can't be blank" + ); + + object.set('password', '1234'); + + assert.equal(object.get('validations.attrs.password.isValid'), false); + assert.equal( + object.get('validations.attrs.password.messages.length'), + 2, + 'Only 2 error message should be present' + ); + assert.equal( + object.get('validations.attrs.password.message'), + 'Password is too short (minimum is 5 characters)' + ); + + object.set('password', '12345'); + + assert.equal(object.get('validations.attrs.password.isValid'), false); + assert.equal( + object.get('validations.attrs.password.messages.length'), + 1, + 'Only 1 error message should be present' + ); + assert.equal( + object.get('validations.attrs.password.message'), + 'Password is not valid' + ); + assert.equal(customValidatorCount, 3, 'Last validator executed 3 times'); + }); - let customValidatorCount = 0; + test('validator should return correct error type', function(assert) { + this.owner.register('validator:presence', PresenceValidator); + this.owner.register('validator:length', LengthValidator); - let Validations = buildValidations({ - password: { - description: 'Password', - validators: [ + let Validations = buildValidations({ + firstName: [ validator('presence', true), - validator('length', { - min: 5 - }), - validator('inline', { - validate() { - customValidatorCount++; - return 'Password is not valid'; - } - }) + validator('length', { min: 5, max: 35 }) + ], + lastName: [ + validator('presence', true), + validator('length', { min: 5, max: 35 }) ] - } - }); + }); - let object = setupObject(this, EmberObject.extend(Validations)); - - assert.equal(object.get('validations.attrs.password.isValid'), false); - assert.equal( - object.get('validations.attrs.password.messages.length'), - 1, - 'Only 1 error message should be present' - ); - assert.equal( - object.get('validations.attrs.password.message'), - "Password can't be blank" - ); - - object.set('password', '1234'); - - assert.equal(object.get('validations.attrs.password.isValid'), false); - assert.equal( - object.get('validations.attrs.password.messages.length'), - 1, - 'Only 1 error message should be present' - ); - assert.equal( - object.get('validations.attrs.password.message'), - 'Password is too short (minimum is 5 characters)' - ); - - object.set('password', '12345'); - - assert.equal(object.get('validations.attrs.password.isValid'), false); - assert.equal( - object.get('validations.attrs.password.messages.length'), - 1, - 'Only 1 error message should be present' - ); - assert.equal( - object.get('validations.attrs.password.message'), - 'Password is not valid' - ); - assert.equal(customValidatorCount, 1, 'Last validator only executed once'); -}); + let obj = setupObject(this, EmberObject.extend(Validations), { + firstName: 'Foo', + lastName: null + }); -test('none lazy validators are actually not lazy', function(assert) { - this.register('validator:length', LengthValidator); - this.register('validator:presence', PresenceValidator); + assert.equal( + obj.get('validations.attrs.firstName.isValid'), + false, + 'isValid was expected to be FALSE' + ); + assert.equal( + obj.get('validations.attrs.lastName.error.type'), + 'presence', + 'error type was expected to be `presence`' + ); + assert.equal( + obj.get('validations.errors.length'), + 2, + 'number of errors was expected to be 2' + ); + assert.equal( + obj.get('validations.errors').filterBy('type', 'presence').length, + 1, + 'number of errors was expected to be 1' + ); + }); - let customValidatorCount = 0; + test('volatile validations should not recompute', function(assert) { + this.owner.register('validator:presence', PresenceValidator); + this.owner.register('validator:length', LengthValidator); - let Validations = buildValidations({ - password: { - description: 'Password', - validators: [ + let Validations = buildValidations({ + firstName: [ validator('presence', true), validator('length', { + dependentKeys: ['model.foo'], min: 5, - lazy: false - }), - validator('inline', { - lazy: false, - validate() { - customValidatorCount++; - return 'Password is not valid'; - } + max: 35, + volatile: true }) ] - } - }); - - let object = setupObject(this, EmberObject.extend(Validations)); - - assert.equal(object.get('validations.attrs.password.isValid'), false); - assert.equal( - object.get('validations.attrs.password.messages.length'), - 2, - 'Only 2 error message should be present' - ); - assert.equal( - object.get('validations.attrs.password.message'), - "Password can't be blank" - ); - - object.set('password', '1234'); - - assert.equal(object.get('validations.attrs.password.isValid'), false); - assert.equal( - object.get('validations.attrs.password.messages.length'), - 2, - 'Only 2 error message should be present' - ); - assert.equal( - object.get('validations.attrs.password.message'), - 'Password is too short (minimum is 5 characters)' - ); - - object.set('password', '12345'); - - assert.equal(object.get('validations.attrs.password.isValid'), false); - assert.equal( - object.get('validations.attrs.password.messages.length'), - 1, - 'Only 1 error message should be present' - ); - assert.equal( - object.get('validations.attrs.password.message'), - 'Password is not valid' - ); - assert.equal(customValidatorCount, 3, 'Last validator executed 3 times'); -}); + }); -test('validator should return correct error type', function(assert) { - this.register('validator:presence', PresenceValidator); - this.register('validator:length', LengthValidator); - - let Validations = buildValidations({ - firstName: [ - validator('presence', true), - validator('length', { min: 5, max: 35 }) - ], - lastName: [ - validator('presence', true), - validator('length', { min: 5, max: 35 }) - ] + let obj = setupObject( + this, + EmberObject.extend(Validations, { + isInvalid: not('validations.attrs.firstName.isValid'), + isInvalidGlobal: not('validations.attrs.isValid') + }), + { + firstName: null + } + ); + + assert.equal( + obj.get('validations.attrs.firstName.isValid'), + false, + 'isValid was expected to be FALSE' + ); + assert.equal( + obj.get('validations.attrs.firstName.message'), + "This field can't be blank" + ); + assert.equal( + obj.get('isInvalid'), + true, + 'isInvalid was expected to be TRUE' + ); + assert.equal( + obj.get('isInvalidGlobal'), + true, + 'isInvalidGlobal was expected to be TRUE' + ); + + obj.set('firstName', 'Offir'); + obj.set('foo', 'bar'); + + assert.equal( + obj.get('isInvalid'), + true, + 'isInvalid was expected to be TRUE' + ); + assert.equal( + obj.get('isInvalidGlobal'), + true, + 'isInvalidGlobal was expected to be TRUE' + ); + assert.equal( + obj.get('validations.attrs.firstName.isValid'), + true, + 'isValid was expected to be TRUE' + ); }); - let obj = setupObject(this, EmberObject.extend(Validations), { - firstName: 'Foo', - lastName: null - }); + test('load test', function(assert) { + this.owner.register('validator:presence', PresenceValidator); - assert.equal( - obj.get('validations.attrs.firstName.isValid'), - false, - 'isValid was expected to be FALSE' - ); - assert.equal( - obj.get('validations.attrs.lastName.error.type'), - 'presence', - 'error type was expected to be `presence`' - ); - assert.equal( - obj.get('validations.errors.length'), - 2, - 'number of errors was expected to be 2' - ); - assert.equal( - obj.get('validations.errors').filterBy('type', 'presence').length, - 1, - 'number of errors was expected to be 1' - ); -}); + let Validations = buildValidations({ + a: validator('presence', true), + b: validator('presence', true), + c: validator('presence', true), + d: validator('presence', true), + e: validator('presence', true) + }); -test('volatile validations should not recompute', function(assert) { - this.register('validator:presence', PresenceValidator); - this.register('validator:length', LengthValidator); - - let Validations = buildValidations({ - firstName: [ - validator('presence', true), - validator('length', { - dependentKeys: ['model.foo'], - min: 5, - max: 35, - volatile: true - }) - ] - }); + let Klass = EmberObject.extend(Validations, { + a: null, + b: null, + c: null, + d: null, + e: null + }); - let obj = setupObject( - this, - EmberObject.extend(Validations, { - isInvalid: not('validations.attrs.firstName.isValid'), - isInvalidGlobal: not('validations.attrs.isValid') - }), - { - firstName: null + let items = A([]); + for (let i = 0; i < 50; i++) { + let obj = setupObject(this, Klass, { + a: i, + b: i, + c: i, + d: i, + e: i + }); + items.push(obj); } - ); - - assert.equal( - obj.get('validations.attrs.firstName.isValid'), - false, - 'isValid was expected to be FALSE' - ); - assert.equal( - obj.get('validations.attrs.firstName.message'), - "This field can't be blank" - ); - assert.equal(obj.get('isInvalid'), true, 'isInvalid was expected to be TRUE'); - assert.equal( - obj.get('isInvalidGlobal'), - true, - 'isInvalidGlobal was expected to be TRUE' - ); - - obj.set('firstName', 'Offir'); - obj.set('foo', 'bar'); - - assert.equal(obj.get('isInvalid'), true, 'isInvalid was expected to be TRUE'); - assert.equal( - obj.get('isInvalidGlobal'), - true, - 'isInvalidGlobal was expected to be TRUE' - ); - assert.equal( - obj.get('validations.attrs.firstName.isValid'), - true, - 'isValid was expected to be TRUE' - ); -}); - -test('load test', function(assert) { - this.register('validator:presence', PresenceValidator); - - let Validations = buildValidations({ - a: validator('presence', true), - b: validator('presence', true), - c: validator('presence', true), - d: validator('presence', true), - e: validator('presence', true) - }); - - let Klass = EmberObject.extend(Validations, { - a: null, - b: null, - c: null, - d: null, - e: null - }); - - let items = A([]); - for (let i = 0; i < 50; i++) { - let obj = setupObject(this, Klass, { - a: i, - b: i, - c: i, - d: i, - e: i - }); - items.push(obj); - } - /* eslint-disable no-console */ - console.time('init'); - items.mapBy('validations.isValid'); - console.timeEnd('init'); - - items.forEach((item, i) => { - item.setProperties({ - a: i + 1000, - b: i + 1000, - c: i + 1000, - d: i + 1000, - e: i + 1000 + /* eslint-disable no-console */ + console.time('init'); + items.mapBy('validations.isValid'); + console.timeEnd('init'); + + items.forEach((item, i) => { + item.setProperties({ + a: i + 1000, + b: i + 1000, + c: i + 1000, + d: i + 1000, + e: i + 1000 + }); }); - }); - console.time('after set'); - A(items).mapBy('validations.isValid'); - console.timeEnd('after set'); - /* eslint-enable no-console */ + console.time('after set'); + A(items).mapBy('validations.isValid'); + console.timeEnd('after set'); + /* eslint-enable no-console */ - assert.ok(true); + assert.ok(true); + }); }); diff --git a/tests/integration/validations/model-relationships-test.js b/tests/integration/validations/model-relationships-test.js index bc4bdc89..7aaead73 100644 --- a/tests/integration/validations/model-relationships-test.js +++ b/tests/integration/validations/model-relationships-test.js @@ -11,7 +11,8 @@ import HasManyValidator from 'ember-cp-validations/validators/has-many'; import AliasValidator from 'ember-cp-validations/validators/alias'; import PresenceValidator from 'ember-cp-validations/validators/presence'; import { validator, buildValidations } from 'ember-cp-validations'; -import { moduleFor, test } from 'ember-qunit'; +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; const Validators = { presence(value, options, model, attr) { @@ -35,140 +36,79 @@ const HasManyValidations = buildValidations({ friends: validator('has-many') }); -moduleFor('foo', 'Integration | Validations | Model Relationships', { - integration: true, - beforeEach() { - this.register('validator:messages', DefaultMessages); - } -}); - -test('belong to validation - no cycle', function(assert) { - this.register('validator:belongs-to', BelongsToValidator); - - let user2 = setupObject(this, EmberObject.extend(Validations), { - firstName: 'John' - }); +module('Integration | Validations | Model Relationships', function(hooks) { + setupTest(hooks); - let user = setupObject(this, EmberObject.extend(BelongsToValidations), { - friend: user2 + hooks.beforeEach(function() { + this.owner.register('validator:messages', DefaultMessages); }); - let { validations, model } = user.get('validations').validateSync(); - - assert.equal(model, user, 'expected model to be the correct model'); - assert.deepEqual( - validations - .get('content') - .getEach('attribute') - .sort(), - ['friend'].sort() - ); - - let friend = validations.get('content').findBy('attribute', 'friend'); - - assert.equal(friend.get('isValid'), false); - assert.equal(friend.get('isValidating'), false); - assert.equal(friend.get('message'), 'lastName should be present'); -}); - -test('belong to validation - with cycle', function(assert) { - this.register('validator:belongs-to', BelongsToValidator); + test('belong to validation - no cycle', function(assert) { + this.owner.register('validator:belongs-to', BelongsToValidator); - let user = setupObject(this, EmberObject.extend(BelongsToValidations)); - user.set('friend', user); - - let { validations, model } = user.get('validations').validateSync(); - - assert.equal(model, user, 'expected model to be the correct model'); - assert.deepEqual( - validations - .get('content') - .getEach('attribute') - .sort(), - ['friend'].sort() - ); + let user2 = setupObject(this, EmberObject.extend(Validations), { + firstName: 'John' + }); - let friend = validations.get('content').findBy('attribute', 'friend'); + let user = setupObject(this, EmberObject.extend(BelongsToValidations), { + friend: user2 + }); - assert.equal(friend.get('isValid'), true); - assert.equal(friend.get('isValidating'), false); - assert.equal(friend.get('message'), undefined); -}); + let { validations, model } = user.get('validations').validateSync(); -test('has-many relationship is sync', function(assert) { - this.register('validator:has-many', HasManyValidator); + assert.equal(model, user, 'expected model to be the correct model'); + assert.deepEqual( + validations + .get('content') + .getEach('attribute') + .sort(), + ['friend'].sort() + ); - let friend = setupObject(this, EmberObject.extend(Validations), { - firstName: 'John' - }); + let friend = validations.get('content').findBy('attribute', 'friend'); - let user = setupObject(this, EmberObject.extend(HasManyValidations), { - friends: [friend] + assert.equal(friend.get('isValid'), false); + assert.equal(friend.get('isValidating'), false); + assert.equal(friend.get('message'), 'lastName should be present'); }); - let { validations, model } = user.get('validations').validateSync(); + test('belong to validation - with cycle', function(assert) { + this.owner.register('validator:belongs-to', BelongsToValidator); - assert.equal(model, user, 'expected model to be the correct model'); - assert.deepEqual( - validations - .get('content') - .getEach('attribute') - .sort(), - ['friends'].sort() - ); + let user = setupObject(this, EmberObject.extend(BelongsToValidations)); + user.set('friend', user); - let friends = validations.get('content').findBy('attribute', 'friends'); + let { validations, model } = user.get('validations').validateSync(); - assert.equal(friends.get('isValid'), false); - assert.equal(friends.get('message'), 'lastName should be present'); -}); - -test('has-many relationship is sync with proxy', function(assert) { - this.register('validator:has-many', HasManyValidator); + assert.equal(model, user, 'expected model to be the correct model'); + assert.deepEqual( + validations + .get('content') + .getEach('attribute') + .sort(), + ['friend'].sort() + ); - let friend = setupObject(this, EmberObject.extend(Validations), { - firstName: 'John' - }); + let friend = validations.get('content').findBy('attribute', 'friend'); - let user = setupObject(this, EmberObject.extend(HasManyValidations), { - friends: ArrayProxy.create({ content: emberArray([friend]) }) + assert.equal(friend.get('isValid'), true); + assert.equal(friend.get('isValidating'), false); + assert.equal(friend.get('message'), undefined); }); - let { validations, model } = user.get('validations').validateSync(); - - assert.equal(model, user, 'expected model to be the correct model'); - assert.deepEqual( - validations - .get('content') - .getEach('attribute') - .sort(), - ['friends'].sort() - ); - - let friends = validations.get('content').findBy('attribute', 'friends'); - - assert.equal(friends.get('isValid'), false); - assert.equal(friends.get('message'), 'lastName should be present'); -}); - -test('has-many relationship is async', function(assert) { - this.register('validator:has-many', HasManyValidator); + test('has-many relationship is sync', function(assert) { + this.owner.register('validator:has-many', HasManyValidator); - let friend = setupObject(this, EmberObject.extend(Validations), { - firstName: 'Offir' - }); + let friend = setupObject(this, EmberObject.extend(Validations), { + firstName: 'John' + }); - let user = setupObject(this, EmberObject.extend(HasManyValidations), { - friends: new EmberPromise(resolve => { - resolve([friend]); - }) - }); + let user = setupObject(this, EmberObject.extend(HasManyValidations), { + friends: [friend] + }); - let validations = user.get('validations').validate(); - assert.equal(user.get('validations.isAsync'), true); - assert.equal(user.get('validations.isValidating'), true); + let { validations, model } = user.get('validations').validateSync(); - validations.then(({ model, validations }) => { assert.equal(model, user, 'expected model to be the correct model'); assert.deepEqual( validations @@ -184,31 +124,19 @@ test('has-many relationship is async', function(assert) { assert.equal(friends.get('message'), 'lastName should be present'); }); - return validations; -}); - -test('has-many relationship is async and isWarning', function(assert) { - this.register('validator:has-many', HasManyValidator); - - let HasManyValidations = buildValidations({ - friends: validator('has-many', { isWarning: true }) - }); + test('has-many relationship is sync with proxy', function(assert) { + this.owner.register('validator:has-many', HasManyValidator); - let friend = setupObject(this, EmberObject.extend(Validations), { - firstName: 'Offir' - }); + let friend = setupObject(this, EmberObject.extend(Validations), { + firstName: 'John' + }); - let user = setupObject(this, EmberObject.extend(HasManyValidations), { - friends: new EmberPromise(resolve => { - resolve([friend]); - }) - }); + let user = setupObject(this, EmberObject.extend(HasManyValidations), { + friends: ArrayProxy.create({ content: emberArray([friend]) }) + }); - let validations = user.get('validations').validate(); - assert.equal(user.get('validations.isAsync'), true); - assert.equal(user.get('validations.isValidating'), true); + let { validations, model } = user.get('validations').validateSync(); - validations.then(({ model, validations }) => { assert.equal(model, user, 'expected model to be the correct model'); assert.deepEqual( validations @@ -220,482 +148,600 @@ test('has-many relationship is async and isWarning', function(assert) { let friends = validations.get('content').findBy('attribute', 'friends'); - assert.equal(friends.get('warning.message'), 'lastName should be present'); - assert.equal(friends.get('warningMessage'), 'lastName should be present'); - assert.equal(friends.get('isValid'), true); + assert.equal(friends.get('isValid'), false); + assert.equal(friends.get('message'), 'lastName should be present'); }); - return validations; -}); + test('has-many relationship is async', function(assert) { + this.owner.register('validator:has-many', HasManyValidator); -test('belongs-to relationship is async', function(assert) { - this.register('validator:belongs-to', BelongsToValidator); + let friend = setupObject(this, EmberObject.extend(Validations), { + firstName: 'Offir' + }); - let friend = setupObject(this, EmberObject.extend(Validations), { - firstName: 'Offir' - }); + let user = setupObject(this, EmberObject.extend(HasManyValidations), { + friends: new EmberPromise(resolve => { + resolve([friend]); + }) + }); - let user = setupObject(this, EmberObject.extend(BelongsToValidations), { - friend: new EmberPromise(resolve => { - resolve(friend); - }) - }); + let validations = user.get('validations').validate(); + assert.equal(user.get('validations.isAsync'), true); + assert.equal(user.get('validations.isValidating'), true); + + validations.then(({ model, validations }) => { + assert.equal(model, user, 'expected model to be the correct model'); + assert.deepEqual( + validations + .get('content') + .getEach('attribute') + .sort(), + ['friends'].sort() + ); - let validations = user.get('validations').validate(); - assert.equal(user.get('validations.isAsync'), true); - assert.equal(user.get('validations.isValidating'), true); + let friends = validations.get('content').findBy('attribute', 'friends'); - validations.then(({ model, validations }) => { - assert.equal(model, user, 'expected model to be the correct model'); - assert.deepEqual( - validations - .get('content') - .getEach('attribute') - .sort(), - ['friend'].sort() - ); - - let friend = validations.get('content').findBy('attribute', 'friend'); + assert.equal(friends.get('isValid'), false); + assert.equal(friends.get('message'), 'lastName should be present'); + }); - assert.equal(friend.get('isValid'), false); - assert.equal(friend.get('message'), 'lastName should be present'); + return validations; }); - return validations; -}); + test('has-many relationship is async and isWarning', function(assert) { + this.owner.register('validator:has-many', HasManyValidator); -test('belongs-to relationship is async and isWarning', function(assert) { - this.register('validator:belongs-to', BelongsToValidator); + let HasManyValidations = buildValidations({ + friends: validator('has-many', { isWarning: true }) + }); - let BelongsToValidations = buildValidations({ - friend: validator('belongs-to', { isWarning: true }) - }); + let friend = setupObject(this, EmberObject.extend(Validations), { + firstName: 'Offir' + }); - let friend = setupObject(this, EmberObject.extend(Validations), { - firstName: 'Offir' - }); + let user = setupObject(this, EmberObject.extend(HasManyValidations), { + friends: new EmberPromise(resolve => { + resolve([friend]); + }) + }); - let user = setupObject(this, EmberObject.extend(BelongsToValidations), { - friend: new EmberPromise(resolve => { - resolve(friend); - }) + let validations = user.get('validations').validate(); + assert.equal(user.get('validations.isAsync'), true); + assert.equal(user.get('validations.isValidating'), true); + + validations.then(({ model, validations }) => { + assert.equal(model, user, 'expected model to be the correct model'); + assert.deepEqual( + validations + .get('content') + .getEach('attribute') + .sort(), + ['friends'].sort() + ); + + let friends = validations.get('content').findBy('attribute', 'friends'); + + assert.equal( + friends.get('warning.message'), + 'lastName should be present' + ); + assert.equal(friends.get('warningMessage'), 'lastName should be present'); + assert.equal(friends.get('isValid'), true); + }); + + return validations; }); - let validations = user.get('validations').validate(); - assert.equal(user.get('validations.isAsync'), true); - assert.equal(user.get('validations.isValidating'), true); + test('belongs-to relationship is async', function(assert) { + this.owner.register('validator:belongs-to', BelongsToValidator); - validations.then(({ model, validations }) => { - assert.equal(model, user, 'expected model to be the correct model'); - assert.deepEqual( - validations - .get('content') - .getEach('attribute') - .sort(), - ['friend'].sort() - ); + let friend = setupObject(this, EmberObject.extend(Validations), { + firstName: 'Offir' + }); - let friend = validations.get('content').findBy('attribute', 'friend'); + let user = setupObject(this, EmberObject.extend(BelongsToValidations), { + friend: new EmberPromise(resolve => { + resolve(friend); + }) + }); - assert.equal(friend.get('warning.message'), 'lastName should be present'); - assert.equal(friend.get('warningMessage'), 'lastName should be present'); - assert.equal(friend.get('isValid'), true); - }); + let validations = user.get('validations').validate(); + assert.equal(user.get('validations.isAsync'), true); + assert.equal(user.get('validations.isValidating'), true); + + validations.then(({ model, validations }) => { + assert.equal(model, user, 'expected model to be the correct model'); + assert.deepEqual( + validations + .get('content') + .getEach('attribute') + .sort(), + ['friend'].sort() + ); - return validations; -}); + let friend = validations.get('content').findBy('attribute', 'friend'); -test('belongs-to relationship is async and does not exist', function(assert) { - this.register('validator:belongs-to', BelongsToValidator); + assert.equal(friend.get('isValid'), false); + assert.equal(friend.get('message'), 'lastName should be present'); + }); - let user = setupObject(this, EmberObject.extend(BelongsToValidations), { - friend: new EmberPromise(resolve => { - resolve(); - }) + return validations; }); - let validations = user.get('validations').validate(); - assert.equal(user.get('validations.isAsync'), true); - assert.equal(user.get('validations.isValidating'), true); + test('belongs-to relationship is async and isWarning', function(assert) { + this.owner.register('validator:belongs-to', BelongsToValidator); - validations.then(({ model, validations }) => { - assert.equal(model, user, 'expected model to be the correct model'); - assert.deepEqual( - validations - .get('content') - .getEach('attribute') - .sort(), - ['friend'].sort() - ); - assert.equal(user.get('validations.isValid'), true); - }); + let BelongsToValidations = buildValidations({ + friend: validator('belongs-to', { isWarning: true }) + }); - return validations; -}); + let friend = setupObject(this, EmberObject.extend(Validations), { + firstName: 'Offir' + }); -test('has-many relationship is async and does not exist', function(assert) { - this.register('validator:has-many', HasManyValidator); + let user = setupObject(this, EmberObject.extend(BelongsToValidations), { + friend: new EmberPromise(resolve => { + resolve(friend); + }) + }); - let user = setupObject(this, EmberObject.extend(HasManyValidations), { - friends: new EmberPromise(resolve => { - resolve(); - }) - }); + let validations = user.get('validations').validate(); + assert.equal(user.get('validations.isAsync'), true); + assert.equal(user.get('validations.isValidating'), true); + + validations.then(({ model, validations }) => { + assert.equal(model, user, 'expected model to be the correct model'); + assert.deepEqual( + validations + .get('content') + .getEach('attribute') + .sort(), + ['friend'].sort() + ); - let validations = user.get('validations').validate(); - assert.equal(user.get('validations.isAsync'), true); - assert.equal(user.get('validations.isValidating'), true); + let friend = validations.get('content').findBy('attribute', 'friend'); - validations.then(({ model, validations }) => { - assert.equal(model, user, 'expected model to be the correct model'); - assert.deepEqual( - validations - .get('content') - .getEach('attribute') - .sort(), - ['friends'].sort() - ); - assert.equal(user.get('validations.isValid'), true); + assert.equal(friend.get('warning.message'), 'lastName should be present'); + assert.equal(friend.get('warningMessage'), 'lastName should be present'); + assert.equal(friend.get('isValid'), true); + }); + + return validations; }); - return validations; -}); + test('belongs-to relationship is async and does not exist', function(assert) { + this.owner.register('validator:belongs-to', BelongsToValidator); + + let user = setupObject(this, EmberObject.extend(BelongsToValidations), { + friend: new EmberPromise(resolve => { + resolve(); + }) + }); -test('belongs-to relationship returns undefined', function(assert) { - this.register('validator:belongs-to', BelongsToValidator); + let validations = user.get('validations').validate(); + assert.equal(user.get('validations.isAsync'), true); + assert.equal(user.get('validations.isValidating'), true); + + validations.then(({ model, validations }) => { + assert.equal(model, user, 'expected model to be the correct model'); + assert.deepEqual( + validations + .get('content') + .getEach('attribute') + .sort(), + ['friend'].sort() + ); + assert.equal(user.get('validations.isValid'), true); + }); - let user = setupObject(this, EmberObject.extend(BelongsToValidations), { - friend: new EmberPromise(resolve => { - resolve({}); // validations object will be undefined - }) + return validations; }); - let validations = user.get('validations').validate(); - assert.equal(user.get('validations.isAsync'), true); - assert.equal(user.get('validations.isValidating'), true); + test('has-many relationship is async and does not exist', function(assert) { + this.owner.register('validator:has-many', HasManyValidator); - validations.then(({ model, validations }) => { - assert.equal(model, user, 'expected model to be the correct model'); - assert.deepEqual( - validations - .get('content') - .getEach('attribute') - .sort(), - ['friend'].sort() - ); + let user = setupObject(this, EmberObject.extend(HasManyValidations), { + friends: new EmberPromise(resolve => { + resolve(); + }) + }); - let friend = validations.get('content').findBy('attribute', 'friend'); + let validations = user.get('validations').validate(); + assert.equal(user.get('validations.isAsync'), true); + assert.equal(user.get('validations.isValidating'), true); + + validations.then(({ model, validations }) => { + assert.equal(model, user, 'expected model to be the correct model'); + assert.deepEqual( + validations + .get('content') + .getEach('attribute') + .sort(), + ['friends'].sort() + ); + assert.equal(user.get('validations.isValid'), true); + }); - assert.equal(friend.get('isValid'), false); - assert.equal(friend.get('message'), undefined); + return validations; }); - return validations; -}); - -test('alias validation - simple', function(assert) { - this.register('validator:alias', AliasValidator); + test('belongs-to relationship returns undefined', function(assert) { + this.owner.register('validator:belongs-to', BelongsToValidator); - let user = setupObject( - this, - EmberObject.extend( - buildValidations({ - firstName: validator('inline', { validate: Validators.presence }), - lastName: validator('inline', { validate: Validators.presence }), - fullName: validator('alias', 'firstName') + let user = setupObject(this, EmberObject.extend(BelongsToValidations), { + friend: new EmberPromise(resolve => { + resolve({}); // validations object will be undefined }) - ) - ); - - user.get('validations').validateSync(); - - assert.equal(user.get('validations.isValid'), false); - assert.equal(user.get('validations.isValidating'), false); - assert.equal(user.get('validations.attrs.firstName.isValid'), false); - assert.equal(user.get('validations.attrs.fullName.isValid'), false); - assert.equal( - user.get('validations.attrs.fullName.message'), - 'firstName should be present' - ); - assert.equal( - user.get('validations.attrs.fullName.error.attribute'), - 'firstName' - ); - assert.equal( - user.get('validations.attrs.fullName.error.parentAttribute'), - 'fullName' - ); - assert.equal( - user.get('validations.attrs.fullName.error.message'), - 'firstName should be present' - ); - - user.set('firstName', 'Offir'); - - assert.equal(user.get('validations.attrs.firstName.isValid'), true); - assert.equal(user.get('validations.attrs.fullName.isValid'), true); -}); + }); -test('alias validation - firstMessageOnly', function(assert) { - this.register('validator:alias', AliasValidator); - - let user = setupObject( - this, - EmberObject.extend( - buildValidations( - { - firstName: [ - validator('inline', { validate: () => 'First error message' }), - validator('inline', { validate: () => 'Second error message' }) - ], - fullName: validator('alias', { - alias: 'firstName', - firstMessageOnly: true - }) - }, - { lazy: false } - ) - ) - ); - - user.get('validations').validateSync(); - - assert.equal(user.get('validations.isValid'), false); - assert.equal(user.get('validations.isValidating'), false); - assert.equal(user.get('validations.attrs.firstName.isValid'), false); - assert.equal(user.get('validations.attrs.firstName.messages.length'), 2); - assert.equal(user.get('validations.attrs.fullName.isValid'), false); - assert.equal(user.get('validations.attrs.fullName.messages.length'), 1); - assert.equal( - user.get('validations.attrs.fullName.message'), - 'First error message' - ); -}); + let validations = user.get('validations').validate(); + assert.equal(user.get('validations.isAsync'), true); + assert.equal(user.get('validations.isValidating'), true); + + validations.then(({ model, validations }) => { + assert.equal(model, user, 'expected model to be the correct model'); + assert.deepEqual( + validations + .get('content') + .getEach('attribute') + .sort(), + ['friend'].sort() + ); -test('alias validation - multiple', function(assert) { - this.register('validator:alias', AliasValidator); + let friend = validations.get('content').findBy('attribute', 'friend'); - let user = setupObject( - this, - EmberObject.extend( - buildValidations( - { + assert.equal(friend.get('isValid'), false); + assert.equal(friend.get('message'), undefined); + }); + + return validations; + }); + + test('alias validation - simple', function(assert) { + this.owner.register('validator:alias', AliasValidator); + + let user = setupObject( + this, + EmberObject.extend( + buildValidations({ firstName: validator('inline', { validate: Validators.presence }), lastName: validator('inline', { validate: Validators.presence }), - fullName: [ - validator('alias', 'firstName'), - validator('alias', 'lastName') - ] - }, - { lazy: false } + fullName: validator('alias', 'firstName') + }) ) - ) - ); - - user.get('validations').validateSync(); - - assert.equal(user.get('validations.isValid'), false); - assert.equal(user.get('validations.isValidating'), false); - assert.equal(user.get('validations.attrs.firstName.isValid'), false); - assert.equal(user.get('validations.attrs.lastName.isValid'), false); - assert.equal(user.get('validations.attrs.fullName.isValid'), false); - assert.deepEqual( - user.get('validations.attrs.fullName.messages').sort(), - ['firstName should be present', 'lastName should be present'].sort() - ); - assert.ok( - emberArray(user.get('validations.attrs.fullName.errors')).isEvery( - 'parentAttribute', + ); + + user.get('validations').validateSync(); + + assert.equal(user.get('validations.isValid'), false); + assert.equal(user.get('validations.isValidating'), false); + assert.equal(user.get('validations.attrs.firstName.isValid'), false); + assert.equal(user.get('validations.attrs.fullName.isValid'), false); + assert.equal( + user.get('validations.attrs.fullName.message'), + 'firstName should be present' + ); + assert.equal( + user.get('validations.attrs.fullName.error.attribute'), + 'firstName' + ); + assert.equal( + user.get('validations.attrs.fullName.error.parentAttribute'), 'fullName' - ) - ); + ); + assert.equal( + user.get('validations.attrs.fullName.error.message'), + 'firstName should be present' + ); - user.set('firstName', 'Offir'); + user.set('firstName', 'Offir'); + + assert.equal(user.get('validations.attrs.firstName.isValid'), true); + assert.equal(user.get('validations.attrs.fullName.isValid'), true); + }); + + test('alias validation - firstMessageOnly', function(assert) { + this.owner.register('validator:alias', AliasValidator); + + let user = setupObject( + this, + EmberObject.extend( + buildValidations( + { + firstName: [ + validator('inline', { validate: () => 'First error message' }), + validator('inline', { validate: () => 'Second error message' }) + ], + fullName: validator('alias', { + alias: 'firstName', + firstMessageOnly: true + }) + }, + { lazy: false } + ) + ) + ); - assert.equal(user.get('validations.attrs.firstName.isValid'), true); - assert.equal(user.get('validations.attrs.lastName.isValid'), false); - assert.equal(user.get('validations.attrs.fullName.isValid'), false); + user.get('validations').validateSync(); - user.set('lastName', 'Golan'); + assert.equal(user.get('validations.isValid'), false); + assert.equal(user.get('validations.isValidating'), false); + assert.equal(user.get('validations.attrs.firstName.isValid'), false); + assert.equal(user.get('validations.attrs.firstName.messages.length'), 2); + assert.equal(user.get('validations.attrs.fullName.isValid'), false); + assert.equal(user.get('validations.attrs.fullName.messages.length'), 1); + assert.equal( + user.get('validations.attrs.fullName.message'), + 'First error message' + ); + }); - assert.equal(user.get('validations.attrs.lastName.isValid'), true); - assert.equal(user.get('validations.attrs.fullName.isValid'), true); -}); + test('alias validation - multiple', function(assert) { + this.owner.register('validator:alias', AliasValidator); + + let user = setupObject( + this, + EmberObject.extend( + buildValidations( + { + firstName: validator('inline', { validate: Validators.presence }), + lastName: validator('inline', { validate: Validators.presence }), + fullName: [ + validator('alias', 'firstName'), + validator('alias', 'lastName') + ] + }, + { lazy: false } + ) + ) + ); -test('presence on empty DS.PromiseObject', function(assert) { - this.register('validator:presence', PresenceValidator); + user.get('validations').validateSync(); - let Validations = buildValidations({ - friend: validator('presence', true) - }); + assert.equal(user.get('validations.isValid'), false); + assert.equal(user.get('validations.isValidating'), false); + assert.equal(user.get('validations.attrs.firstName.isValid'), false); + assert.equal(user.get('validations.attrs.lastName.isValid'), false); + assert.equal(user.get('validations.attrs.fullName.isValid'), false); + assert.deepEqual( + user.get('validations.attrs.fullName.messages').sort(), + ['firstName should be present', 'lastName should be present'].sort() + ); + assert.ok( + emberArray(user.get('validations.attrs.fullName.errors')).isEvery( + 'parentAttribute', + 'fullName' + ) + ); + + user.set('firstName', 'Offir'); + + assert.equal(user.get('validations.attrs.firstName.isValid'), true); + assert.equal(user.get('validations.attrs.lastName.isValid'), false); + assert.equal(user.get('validations.attrs.fullName.isValid'), false); - let user = setupObject(this, EmberObject.extend(Validations), { - friend: DS.PromiseObject.create() + user.set('lastName', 'Golan'); + + assert.equal(user.get('validations.attrs.lastName.isValid'), true); + assert.equal(user.get('validations.attrs.fullName.isValid'), true); }); - let { validations, model } = user.get('validations').validateSync(); + test('presence on empty DS.PromiseObject', function(assert) { + this.owner.register('validator:presence', PresenceValidator); - assert.equal(model, user, 'expected model to be the correct model'); - assert.deepEqual( - validations - .get('content') - .getEach('attribute') - .sort(), - ['friend'].sort() - ); + let Validations = buildValidations({ + friend: validator('presence', true) + }); - let friend = validations.get('content').findBy('attribute', 'friend'); + let user = setupObject(this, EmberObject.extend(Validations), { + friend: DS.PromiseObject.create() + }); - assert.equal(friend.get('isValid'), false); - assert.equal(friend.get('message'), "This field can't be blank"); -}); + let { validations, model } = user.get('validations').validateSync(); -test('presence on empty DS.PromiseArray', function(assert) { - this.register('validator:presence', PresenceValidator); + assert.equal(model, user, 'expected model to be the correct model'); + assert.deepEqual( + validations + .get('content') + .getEach('attribute') + .sort(), + ['friend'].sort() + ); - let Validations = buildValidations({ - friends: validator('presence', true) - }); + let friend = validations.get('content').findBy('attribute', 'friend'); - let user = setupObject(this, EmberObject.extend(Validations), { - friends: DS.PromiseArray.create() + assert.equal(friend.get('isValid'), false); + assert.equal(friend.get('message'), "This field can't be blank"); }); - let { validations, model } = user.get('validations').validateSync(); + test('presence on empty DS.PromiseArray', function(assert) { + this.owner.register('validator:presence', PresenceValidator); - assert.equal(model, user, 'expected model to be the correct model'); - assert.deepEqual( - validations - .get('content') - .getEach('attribute') - .sort(), - ['friends'].sort() - ); + let Validations = buildValidations({ + friends: validator('presence', true) + }); - let friends = validations.get('content').findBy('attribute', 'friends'); + let user = setupObject(this, EmberObject.extend(Validations), { + friends: DS.PromiseArray.create() + }); - assert.equal(friends.get('isValid'), false); - assert.equal(friends.get('message'), "This field can't be blank"); -}); + let { validations, model } = user.get('validations').validateSync(); -test('debounce should work across nested HasMany relationships', function(assert) { - this.register('validator:presence', PresenceValidator); - this.register('validator:has-many', HasManyValidator); + assert.equal(model, user, 'expected model to be the correct model'); + assert.deepEqual( + validations + .get('content') + .getEach('attribute') + .sort(), + ['friends'].sort() + ); - let done = assert.async(); + let friends = validations.get('content').findBy('attribute', 'friends'); - let FriendValidations = buildValidations({ - name: validator('presence', { presence: true, debounce: 50 }) + assert.equal(friends.get('isValid'), false); + assert.equal(friends.get('message'), "This field can't be blank"); }); - let friend = setupObject(this, EmberObject.extend(FriendValidations)); - let user = setupObject(this, EmberObject.extend(HasManyValidations), { - friends: new EmberPromise(resolve => { - resolve([friend]); - }) - }); + test('debounce should work across nested HasMany relationships', function(assert) { + this.owner.register('validator:presence', PresenceValidator); + this.owner.register('validator:has-many', HasManyValidator); - user - .validate() - .then(({ validations }) => { - assert.equal( - friend.get('validations.isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - user.get('validations.isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - validations.get('isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - validations.get('isValid'), - false, - 'User should not be valid' - ); + let done = assert.async(); - friend.set('name', 'Offir'); - return user.validate(); - }) - .then(({ validations }) => { - assert.equal( - friend.get('validations.isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - user.get('validations.isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - validations.get('isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal(validations.get('isValid'), true, 'User should be valid'); - done(); + let FriendValidations = buildValidations({ + name: validator('presence', { presence: true, debounce: 50 }) }); -}); -test('debounce should work across nested BelongsTo relationships', function(assert) { - this.register('validator:presence', PresenceValidator); - this.register('validator:belongs-to', BelongsToValidator); + let friend = setupObject(this, EmberObject.extend(FriendValidations)); + let user = setupObject(this, EmberObject.extend(HasManyValidations), { + friends: new EmberPromise(resolve => { + resolve([friend]); + }) + }); - let done = assert.async(); + user + .validate() + .then(({ validations }) => { + assert.equal( + friend.get('validations.isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + user.get('validations.isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + validations.get('isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + validations.get('isValid'), + false, + 'User should not be valid' + ); + + friend.set('name', 'Offir'); + return user.validate(); + }) + .then(({ validations }) => { + assert.equal( + friend.get('validations.isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + user.get('validations.isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + validations.get('isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal(validations.get('isValid'), true, 'User should be valid'); + done(); + }); + }); + + test('debounce should work across nested BelongsTo relationships', function(assert) { + this.owner.register('validator:presence', PresenceValidator); + this.owner.register('validator:belongs-to', BelongsToValidator); + + let done = assert.async(); + + let FriendValidations = buildValidations({ + name: validator('presence', { presence: true, debounce: 50 }) + }); - let FriendValidations = buildValidations({ - name: validator('presence', { presence: true, debounce: 50 }) - }); + let friend = setupObject(this, EmberObject.extend(FriendValidations)); - let friend = setupObject(this, EmberObject.extend(FriendValidations)); + let user = setupObject(this, EmberObject.extend(BelongsToValidations), { + friend: new EmberPromise(resolve => { + resolve(friend); + }) + }); - let user = setupObject(this, EmberObject.extend(BelongsToValidations), { - friend: new EmberPromise(resolve => { - resolve(friend); - }) - }); + user + .validate() + .then(({ validations }) => { + assert.equal( + friend.get('validations.isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + user.get('validations.isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + validations.get('isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + validations.get('isValid'), + false, + 'User should not be valid' + ); + + friend.set('name', 'Offir'); + return user.validate(); + }) + .then(({ validations }) => { + assert.equal( + friend.get('validations.isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + user.get('validations.isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + validations.get('isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal(validations.get('isValid'), true, 'User should be valid'); + done(); + }); + }); + + test('Validations should work across two-way BelongsTo relationships', function(assert) { + this.owner.register('validator:presence', PresenceValidator); + this.owner.register('validator:belongs-to', BelongsToValidator); + + let done = assert.async(); + + let user2 = setupObject(this, EmberObject.extend(BelongsToValidations)); + + let user = setupObject(this, EmberObject.extend(BelongsToValidations), { + friend: new EmberPromise(resolve => { + resolve(user2); + }) + }); - user - .validate() - .then(({ validations }) => { - assert.equal( - friend.get('validations.isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - user.get('validations.isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - validations.get('isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - validations.get('isValid'), - false, - 'User should not be valid' - ); + user2.set( + 'friend', + new EmberPromise(resolve => { + resolve(user); + }) + ); - friend.set('name', 'Offir'); - return user.validate(); - }) - .then(({ validations }) => { + user.validate().then(({ validations }) => { assert.equal( - friend.get('validations.isValidating'), + user.get('validations.isValidating'), false, 'All promises should be resolved' ); assert.equal( - user.get('validations.isValidating'), + user2.get('validations.isValidating'), false, 'All promises should be resolved' ); @@ -707,46 +753,5 @@ test('debounce should work across nested BelongsTo relationships', function(asse assert.equal(validations.get('isValid'), true, 'User should be valid'); done(); }); -}); - -test('Validations should work across two-way BelongsTo relationships', function(assert) { - this.register('validator:presence', PresenceValidator); - this.register('validator:belongs-to', BelongsToValidator); - - let done = assert.async(); - - let user2 = setupObject(this, EmberObject.extend(BelongsToValidations)); - - let user = setupObject(this, EmberObject.extend(BelongsToValidations), { - friend: new EmberPromise(resolve => { - resolve(user2); - }) - }); - - user2.set( - 'friend', - new EmberPromise(resolve => { - resolve(user); - }) - ); - - user.validate().then(({ validations }) => { - assert.equal( - user.get('validations.isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - user2.get('validations.isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - validations.get('isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal(validations.get('isValid'), true, 'User should be valid'); - done(); }); }); diff --git a/tests/integration/validators/composable-test.js b/tests/integration/validators/composable-test.js index 946fb55e..bc7bbb74 100644 --- a/tests/integration/validators/composable-test.js +++ b/tests/integration/validators/composable-test.js @@ -5,221 +5,223 @@ import BaseValidator from 'ember-cp-validations/validators/base'; import EmberObject from '@ember/object'; import setupObject from '../../helpers/setup-object'; import { validator, buildValidations } from 'ember-cp-validations'; -import { moduleFor, test } from 'ember-qunit'; +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; import { Promise } from 'rsvp'; const ComposedValidations = buildValidations({ value: validator('composed') }); -moduleFor('foo', 'Integration | Validators | Composable', { - integration: true, - beforeEach() { - this.register('validator:messages', DefaultMessages); - } -}); +module('Integration | Validators | Composable', function(hooks) { + setupTest(hooks); -test('Composability - simple', function(assert) { - assert.expect(5); - - this.register('validator:presence', PresenceValidator); - this.register( - 'validator:composed', - BaseValidator.extend({ - validate(value) { - return this.test('presence', value, { presence: true }); - } - }) - ); - - const obj = setupObject(this, EmberObject.extend(ComposedValidations), { - value: '' + hooks.beforeEach(function() { + this.owner.register('validator:messages', DefaultMessages); }); - assert.equal(obj.get('validations.isValid'), false); - assert.equal(obj.get('validations.isValidating'), false); - assert.equal(obj.get('validations.message'), "This field can't be blank"); + test('Composability - simple', function(assert) { + assert.expect(5); - obj.set('value', 'foo'); + this.owner.register('validator:presence', PresenceValidator); + this.owner.register( + 'validator:composed', + BaseValidator.extend({ + validate(value) { + return this.test('presence', value, { presence: true }); + } + }) + ); - assert.equal(obj.get('validations.isValid'), true); - assert.equal(obj.get('validations.isValidating'), false); -}); + const obj = setupObject(this, EmberObject.extend(ComposedValidations), { + value: '' + }); -test('Composability - multiple', function(assert) { - assert.expect(8); + assert.equal(obj.get('validations.isValid'), false); + assert.equal(obj.get('validations.isValidating'), false); + assert.equal(obj.get('validations.message'), "This field can't be blank"); - this.register('validator:presence', PresenceValidator); - this.register('validator:length', LengthValidator); - this.register( - 'validator:composed', - BaseValidator.extend({ - validate(value) { - let result = this.test('presence', value, { presence: true }); + obj.set('value', 'foo'); - if (!result.isValid) { - return result.message; - } + assert.equal(obj.get('validations.isValid'), true); + assert.equal(obj.get('validations.isValidating'), false); + }); + + test('Composability - multiple', function(assert) { + assert.expect(8); - result = this.test('length', value, { max: 5 }); + this.owner.register('validator:presence', PresenceValidator); + this.owner.register('validator:length', LengthValidator); + this.owner.register( + 'validator:composed', + BaseValidator.extend({ + validate(value) { + let result = this.test('presence', value, { presence: true }); - if (!result.isValid) { - return result.message; + if (!result.isValid) { + return result.message; + } + + result = this.test('length', value, { max: 5 }); + + if (!result.isValid) { + return result.message; + } + + return true; } + }) + ); - return true; - } - }) - ); + const obj = setupObject(this, EmberObject.extend(ComposedValidations), { + value: '' + }); - const obj = setupObject(this, EmberObject.extend(ComposedValidations), { - value: '' - }); + assert.equal(obj.get('validations.isValid'), false); + assert.equal(obj.get('validations.isValidating'), false); + assert.equal(obj.get('validations.message'), "This field can't be blank"); - assert.equal(obj.get('validations.isValid'), false); - assert.equal(obj.get('validations.isValidating'), false); - assert.equal(obj.get('validations.message'), "This field can't be blank"); + obj.set('value', 'foobar'); - obj.set('value', 'foobar'); + assert.equal(obj.get('validations.isValid'), false); + assert.equal(obj.get('validations.isValidating'), false); + assert.equal( + obj.get('validations.message'), + 'This field is too long (maximum is 5 characters)' + ); - assert.equal(obj.get('validations.isValid'), false); - assert.equal(obj.get('validations.isValidating'), false); - assert.equal( - obj.get('validations.message'), - 'This field is too long (maximum is 5 characters)' - ); + obj.set('value', 'foo'); - obj.set('value', 'foo'); + assert.equal(obj.get('validations.isValid'), true); + assert.equal(obj.get('validations.isValidating'), false); + }); - assert.equal(obj.get('validations.isValid'), true); - assert.equal(obj.get('validations.isValidating'), false); -}); + test('Composability - async', async function(assert) { + assert.expect(8); -test('Composability - async', async function(assert) { - assert.expect(8); - - this.register( - 'validator:async-resolve', - BaseValidator.extend({ - validate(value) { - return Promise.resolve( - value.includes('foo') ? true : 'Must include foo!' - ); - } - }) - ); - - this.register( - 'validator:async-reject', - BaseValidator.extend({ - validate(value) { - return Promise.reject( - value.includes('bar') ? true : 'Must include bar!' - ); - } - }) - ); - - this.register( - 'validator:composed', - BaseValidator.extend({ - async validate(value) { - let result = await this.test('async-resolve', value); - - if (!result.isValid) { - return result.message; + this.owner.register( + 'validator:async-resolve', + BaseValidator.extend({ + validate(value) { + return Promise.resolve( + value.includes('foo') ? true : 'Must include foo!' + ); } + }) + ); + + this.owner.register( + 'validator:async-reject', + BaseValidator.extend({ + validate(value) { + return Promise.reject( + value.includes('bar') ? true : 'Must include bar!' + ); + } + }) + ); + + this.owner.register( + 'validator:composed', + BaseValidator.extend({ + async validate(value) { + let result = await this.test('async-resolve', value); + + if (!result.isValid) { + return result.message; + } - result = await this.test('async-reject', value); + result = await this.test('async-reject', value); - if (!result.isValid) { - return result.message; + if (!result.isValid) { + return result.message; + } + + return true; } + }) + ); - return true; - } - }) - ); + const obj = setupObject(this, EmberObject.extend(ComposedValidations), { + value: '' + }); - const obj = setupObject(this, EmberObject.extend(ComposedValidations), { - value: '' - }); + await obj.validate(); - await obj.validate(); + assert.equal(obj.get('validations.isValid'), false); + assert.equal(obj.get('validations.isValidating'), false); + assert.equal(obj.get('validations.message'), 'Must include foo!'); - assert.equal(obj.get('validations.isValid'), false); - assert.equal(obj.get('validations.isValidating'), false); - assert.equal(obj.get('validations.message'), 'Must include foo!'); + obj.set('value', 'foo'); + await obj.validate(); - obj.set('value', 'foo'); - await obj.validate(); + assert.equal(obj.get('validations.isValid'), false); + assert.equal(obj.get('validations.isValidating'), false); + assert.equal(obj.get('validations.message'), 'Must include bar!'); - assert.equal(obj.get('validations.isValid'), false); - assert.equal(obj.get('validations.isValidating'), false); - assert.equal(obj.get('validations.message'), 'Must include bar!'); + obj.set('value', 'foobar'); + await obj.validate(); - obj.set('value', 'foobar'); - await obj.validate(); + assert.equal(obj.get('validations.isValid'), true); + assert.equal(obj.get('validations.isValidating'), false); + }); - assert.equal(obj.get('validations.isValid'), true); - assert.equal(obj.get('validations.isValidating'), false); -}); + test('Composability - unsupported types', function(assert) { + const unsupportedTypes = ['alias', 'belongs-to', 'dependent', 'has-many']; -test('Composability - unsupported types', function(assert) { - const unsupportedTypes = ['alias', 'belongs-to', 'dependent', 'has-many']; + assert.expect(unsupportedTypes.length); - assert.expect(unsupportedTypes.length); + unsupportedTypes.forEach(type => + this.owner.register(`validator:${type}`, BaseValidator) + ); - unsupportedTypes.forEach(type => - this.register(`validator:${type}`, BaseValidator) - ); + this.owner.register( + 'validator:composed', + BaseValidator.extend({ + validate(type) { + this.test(type); + } + }) + ); - this.register( - 'validator:composed', - BaseValidator.extend({ - validate(type) { - this.test(type); - } - }) - ); + const obj = setupObject(this, EmberObject.extend(ComposedValidations), { + value: '' + }); - const obj = setupObject(this, EmberObject.extend(ComposedValidations), { - value: '' + unsupportedTypes.forEach(type => { + obj.set('value', type); + assert.throws(() => obj.validateSync(), new RegExp(type)); + }); }); - unsupportedTypes.forEach(type => { - obj.set('value', type); - assert.throws(() => obj.validateSync(), new RegExp(type)); - }); -}); + test('Validators get cached', function(assert) { + assert.expect(3); -test('Validators get cached', function(assert) { - assert.expect(3); + this.owner.register('validator:presence', PresenceValidator); + this.owner.register( + 'validator:composed', + BaseValidator.extend({ + validate(value) { + const cache = this.get('_testValidatorCache'); - this.register('validator:presence', PresenceValidator); - this.register( - 'validator:composed', - BaseValidator.extend({ - validate(value) { - const cache = this.get('_testValidatorCache'); + assert.notOk(cache.presence); - assert.notOk(cache.presence); + this.test('presence', value, { presence: true }); - this.test('presence', value, { presence: true }); + const presenceValidator = cache.presence; + assert.ok(cache.presence); - const presenceValidator = cache.presence; - assert.ok(cache.presence); + this.test('presence', value, { presence: false }); - this.test('presence', value, { presence: false }); + assert.equal(presenceValidator, cache.presence); + } + }) + ); - assert.equal(presenceValidator, cache.presence); - } - }) - ); + const obj = setupObject(this, EmberObject.extend(ComposedValidations), { + value: '' + }); - const obj = setupObject(this, EmberObject.extend(ComposedValidations), { - value: '' + obj.validateSync(); }); - - obj.validateSync(); }); diff --git a/tests/unit/utils/assign-test.js b/tests/unit/utils/assign-test.js index 4ea97dfa..2dd727e8 100644 --- a/tests/unit/utils/assign-test.js +++ b/tests/unit/utils/assign-test.js @@ -2,37 +2,37 @@ import EmberObject, { computed } from '@ember/object'; import { module, test } from 'qunit'; import deepSet from 'ember-cp-validations/utils/deep-set'; -module('Unit | Utils | deepSet'); +module('Unit | Utils | deepSet', function() { + test('single level', function(assert) { + let obj = {}; + deepSet(obj, 'foo.bar', 1); + assert.deepEqual(obj, { foo: { bar: 1 } }); + }); -test('single level', function(assert) { - let obj = {}; - deepSet(obj, 'foo.bar', 1); - assert.deepEqual(obj, { foo: { bar: 1 } }); -}); + test('single level - ember object', function(assert) { + let obj = EmberObject.create(); + deepSet(obj, 'foo.bar', 1, true); + assert.ok(obj.foo instanceof EmberObject); + assert.equal(obj.get('foo.bar'), 1); + }); -test('single level - ember object', function(assert) { - let obj = EmberObject.create(); - deepSet(obj, 'foo.bar', 1, true); - assert.ok(obj.foo instanceof EmberObject); - assert.equal(obj.get('foo.bar'), 1); -}); + test('single level - ember object w/ CP', function(assert) { + let obj = EmberObject.create(); + deepSet(obj, 'foo.bar', computed(() => 1), true); + assert.ok(obj.foo instanceof EmberObject); + assert.equal(obj.get('foo.bar'), 1); + }); -test('single level - ember object w/ CP', function(assert) { - let obj = EmberObject.create(); - deepSet(obj, 'foo.bar', computed(() => 1), true); - assert.ok(obj.foo instanceof EmberObject); - assert.equal(obj.get('foo.bar'), 1); -}); - -test('multi level', function(assert) { - let obj = {}; - deepSet(obj, 'foo.bar.baz.boo', 1); - assert.deepEqual(obj, { foo: { bar: { baz: { boo: 1 } } } }); -}); + test('multi level', function(assert) { + let obj = {}; + deepSet(obj, 'foo.bar.baz.boo', 1); + assert.deepEqual(obj, { foo: { bar: { baz: { boo: 1 } } } }); + }); -test('multi level - ember object', function(assert) { - let obj = EmberObject.create(); - deepSet(obj, 'foo.bar.baz.boo', 1, true); - assert.ok(obj.foo.bar.baz instanceof EmberObject); - assert.equal(obj.get('foo.bar.baz.boo'), 1); + test('multi level - ember object', function(assert) { + let obj = EmberObject.create(); + deepSet(obj, 'foo.bar.baz.boo', 1, true); + assert.ok(obj.foo.bar.baz instanceof EmberObject); + assert.equal(obj.get('foo.bar.baz.boo'), 1); + }); }); diff --git a/tests/unit/utils/flatten-test.js b/tests/unit/utils/flatten-test.js index f0cd8df5..6b49284e 100644 --- a/tests/unit/utils/flatten-test.js +++ b/tests/unit/utils/flatten-test.js @@ -1,16 +1,16 @@ import { module, test } from 'qunit'; import { flatten } from 'ember-cp-validations/utils/array'; -module('Unit | Utils | array:flatten'); +module('Unit | Utils | array:flatten', function() { + test('flattens an array of arrays', function(assert) { + let result = flatten([[1], [2, 3], [4, 5]]); -test('flattens an array of arrays', function(assert) { - let result = flatten([[1], [2, 3], [4, 5]]); + assert.deepEqual(result, [1, 2, 3, 4, 5]); + }); - assert.deepEqual(result, [1, 2, 3, 4, 5]); -}); - -test('flattens an array of arrays of arrays ;P', function(assert) { - let result = flatten([[[1], [2, 3]], [4, 5]]); + test('flattens an array of arrays of arrays ;P', function(assert) { + let result = flatten([[[1], [2, 3]], [4, 5]]); - assert.deepEqual(result, [1, 2, 3, 4, 5]); + assert.deepEqual(result, [1, 2, 3, 4, 5]); + }); }); diff --git a/tests/unit/utils/should-call-super-test.js b/tests/unit/utils/should-call-super-test.js index 64a75204..59f7f046 100644 --- a/tests/unit/utils/should-call-super-test.js +++ b/tests/unit/utils/should-call-super-test.js @@ -2,32 +2,32 @@ import EmberObject, { computed } from '@ember/object'; import { module, test } from 'qunit'; import shouldCallSuper from 'ember-cp-validations/utils/should-call-super'; -module('Unit | Utils | shouldCallSuper'); +module('Unit | Utils | shouldCallSuper', function() { + test('shouldCallSuper - true', function(assert) { + let Parent = EmberObject.extend({ + foo: computed(function() {}) + }); -test('shouldCallSuper - true', function(assert) { - let Parent = EmberObject.extend({ - foo: computed(function() {}) - }); + let Child = Parent.extend({ + foo: computed(function() { + assert.ok(shouldCallSuper(this, 'foo')); + }) + }); - let Child = Parent.extend({ - foo: computed(function() { - assert.ok(shouldCallSuper(this, 'foo')); - }) + let child = Child.create(); + child.get('foo'); }); - let child = Child.create(); - child.get('foo'); -}); + test('shouldCallSuper - false', function(assert) { + let Parent = EmberObject.extend(); -test('shouldCallSuper - false', function(assert) { - let Parent = EmberObject.extend(); + let Child = Parent.extend({ + foo: computed(function() { + assert.ok(!shouldCallSuper(this, 'foo')); + }) + }); - let Child = Parent.extend({ - foo: computed(function() { - assert.ok(!shouldCallSuper(this, 'foo')); - }) + let child = Child.create(); + child.get('foo'); }); - - let child = Child.create(); - child.get('foo'); }); diff --git a/tests/unit/validations/ds-model-test.js b/tests/unit/validations/ds-model-test.js index 6d643c0e..7384e50f 100644 --- a/tests/unit/validations/ds-model-test.js +++ b/tests/unit/validations/ds-model-test.js @@ -1,66 +1,73 @@ import { run } from '@ember/runloop'; -import { moduleForModel, test } from 'ember-qunit'; +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; -moduleForModel('signup', 'Unit | Validations | DS.Model', { - needs: ['validator:presence', 'validator:inline'] -}); +module('Unit | Validations | DS.Model', function(hooks) { + setupTest(hooks); + + test('create model with defaults', function(assert) { + let object = run(() => + this.owner.lookup('service:store').createRecord('signup') + ); -test('create model with defaults', function(assert) { - let object = this.subject(); + assert.equal( + object.get('validations.attrs.acceptTerms.isDirty'), + false, + 'isDirty was expected to be FALSE' + ); + assert.equal( + object.get('validations.attrs.acceptTerms.isValid'), + false, + 'isValid was expected to be FALSE' + ); - assert.equal( - object.get('validations.attrs.acceptTerms.isDirty'), - false, - 'isDirty was expected to be FALSE' - ); - assert.equal( - object.get('validations.attrs.acceptTerms.isValid'), - false, - 'isValid was expected to be FALSE' - ); + run(() => { + object.set('acceptTerms', true); + }); - run(() => { - object.set('acceptTerms', true); + assert.equal( + object.get('validations.attrs.acceptTerms.isDirty'), + true, + 'isDirty was expected to be TRUE' + ); + assert.equal( + object.get('validations.attrs.acceptTerms.isValid'), + true, + 'isValid was expected to be TRUE' + ); }); - assert.equal( - object.get('validations.attrs.acceptTerms.isDirty'), - true, - 'isDirty was expected to be TRUE' - ); - assert.equal( - object.get('validations.attrs.acceptTerms.isValid'), - true, - 'isValid was expected to be TRUE' - ); -}); + test('create model overriding defaults', function(assert) { + let object = run(() => + this.owner + .lookup('service:store') + .createRecord('signup', { acceptTerms: true }) + ); -test('create model overriding defaults', function(assert) { - let object = this.subject({ acceptTerms: true }); + assert.equal( + object.get('validations.attrs.acceptTerms.isDirty'), + true, + 'isDirty was expected to be TRUE' + ); + assert.equal( + object.get('validations.attrs.acceptTerms.isValid'), + true, + 'isValid was expected to be TRUE' + ); - assert.equal( - object.get('validations.attrs.acceptTerms.isDirty'), - true, - 'isDirty was expected to be TRUE' - ); - assert.equal( - object.get('validations.attrs.acceptTerms.isValid'), - true, - 'isValid was expected to be TRUE' - ); + run(() => { + object.set('acceptTerms', false); + }); - run(() => { - object.set('acceptTerms', false); + assert.equal( + object.get('validations.attrs.acceptTerms.isDirty'), + false, + 'isDirty was expected to be FALSE' + ); + assert.equal( + object.get('validations.attrs.acceptTerms.isValid'), + false, + 'isValid was expected to be FALSE' + ); }); - - assert.equal( - object.get('validations.attrs.acceptTerms.isDirty'), - false, - 'isDirty was expected to be FALSE' - ); - assert.equal( - object.get('validations.attrs.acceptTerms.isValid'), - false, - 'isValid was expected to be FALSE' - ); }); diff --git a/tests/unit/validations/nested-model-relationship-test.js b/tests/unit/validations/nested-model-relationship-test.js index 968f3333..58243f9e 100644 --- a/tests/unit/validations/nested-model-relationship-test.js +++ b/tests/unit/validations/nested-model-relationship-test.js @@ -1,505 +1,515 @@ import { run } from '@ember/runloop'; -import { moduleForModel, test } from 'ember-qunit'; - -moduleForModel('order', 'Unit | Validations | Nested Model Relationships', { - needs: [ - 'validator:messages', - 'validator:ds-error', - 'validator:presence', - 'validator:length', - 'validator:number', - 'validator:belongs-to', - 'validator:has-many', - 'model:order-line', - 'model:order-selection', - 'model:order-selection-question' - ] -}); - -test('order with invalid question shows invalid', function(assert) { - assert.expect(11); - let order = this.subject({ source: 'external' }); - - let orderLine, orderSelection, orderSelectionQuestion; - - let store = this.store(); - run(() => { - orderLine = store.createRecord('order-line', { order, type: 'item' }); - orderSelection = store.createRecord('order-selection', { - order, - line: orderLine, - quantity: 1 - }); - orderSelectionQuestion = store.createRecord('order-selection-question', { - order, - selection: orderSelection - }); - store.createRecord('order-selection-question', { - order, - selection: orderSelection, - text: 'foo' +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; + +module('Unit | Validations | Nested Model Relationships', function(hooks) { + setupTest(hooks); + + test('order with invalid question shows invalid', function(assert) { + assert.expect(11); + let order = run(() => + this.owner + .lookup('service:store') + .createRecord('order', { source: 'external' }) + ); + + let orderLine, orderSelection, orderSelectionQuestion; + + let store = this.owner.lookup('service:store'); + run(() => { + orderLine = store.createRecord('order-line', { order, type: 'item' }); + orderSelection = store.createRecord('order-selection', { + order, + line: orderLine, + quantity: 1 + }); + orderSelectionQuestion = store.createRecord('order-selection-question', { + order, + selection: orderSelection + }); + store.createRecord('order-selection-question', { + order, + selection: orderSelection, + text: 'foo' + }); }); + + assert.equal(order.get('lines.length'), 1, 'Order has 1 Order Line'); + assert.equal( + orderLine.get('selections.length'), + 1, + 'Order Line has 1 Order Selection' + ); + assert.equal( + orderSelection.get('questions.length'), + 2, + 'Order Selection has 2 Order Selection Questions' + ); + + let done = assert.async(); + + order + .validate() + .then(({ validations }) => { + assert.equal( + validations.get('isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + validations.get('isValid'), + false, + 'Order should not be valid because of Order Selection Question' + ); + return orderLine.validate(); + }) + .then(({ validations }) => { + assert.equal( + validations.get('isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + validations.get('isValid'), + false, + 'Order Line should not be valid because of Order Selection Question' + ); + return orderSelection.validate(); + }) + .then(({ validations }) => { + assert.equal( + validations.get('isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + validations.get('isValid'), + false, + 'Order Selection should not be valid because of Order Selection Question' + ); + return orderSelectionQuestion.validate(); + }) + .then(({ validations }) => { + assert.equal( + validations.get('isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + validations.get('isValid'), + false, + 'Order Selection Question should not be valid' + ); + done(); + }); }); - assert.equal(order.get('lines.length'), 1, 'Order has 1 Order Line'); - assert.equal( - orderLine.get('selections.length'), - 1, - 'Order Line has 1 Order Selection' - ); - assert.equal( - orderSelection.get('questions.length'), - 2, - 'Order Selection has 2 Order Selection Questions' - ); - - let done = assert.async(); - - order - .validate() - .then(({ validations }) => { - assert.equal( - validations.get('isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - validations.get('isValid'), - false, - 'Order should not be valid because of Order Selection Question' - ); - return orderLine.validate(); - }) - .then(({ validations }) => { - assert.equal( - validations.get('isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - validations.get('isValid'), - false, - 'Order Line should not be valid because of Order Selection Question' - ); - return orderSelection.validate(); - }) - .then(({ validations }) => { - assert.equal( - validations.get('isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - validations.get('isValid'), - false, - 'Order Selection should not be valid because of Order Selection Question' - ); - return orderSelectionQuestion.validate(); - }) - .then(({ validations }) => { - assert.equal( - validations.get('isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - validations.get('isValid'), - false, - 'Order Selection Question should not be valid' - ); - done(); + test('order with valid question shows valid', function(assert) { + assert.expect(11); + let order = run(() => + this.owner + .lookup('service:store') + .createRecord('order', { source: 'external' }) + ); + + let orderLine, orderSelection, orderSelectionQuestion; + + let store = this.owner.lookup('service:store'); + run(() => { + orderLine = store.createRecord('order-line', { order, type: 'item' }); + orderSelection = store.createRecord('order-selection', { + order, + line: orderLine, + quantity: 1 + }); + orderSelectionQuestion = store.createRecord('order-selection-question', { + order, + selection: orderSelection, + text: 'answer' + }); }); -}); -test('order with valid question shows valid', function(assert) { - assert.expect(11); - let order = this.subject({ source: 'external' }); - - let orderLine, orderSelection, orderSelectionQuestion; - - let store = this.store(); - run(() => { - orderLine = store.createRecord('order-line', { order, type: 'item' }); - orderSelection = store.createRecord('order-selection', { - order, - line: orderLine, - quantity: 1 - }); - orderSelectionQuestion = store.createRecord('order-selection-question', { - order, - selection: orderSelection, - text: 'answer' - }); + assert.equal(order.get('lines.length'), 1, 'Order has 1 Order Line'); + assert.equal( + orderLine.get('selections.length'), + 1, + 'Order Line has 1 Order Selection' + ); + assert.equal( + orderSelection.get('questions.length'), + 1, + 'Order Selection has 1 Order Selection Question' + ); + + let done = assert.async(); + + order + .validate() + .then(({ validations }) => { + assert.equal( + validations.get('isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + validations.get('isValid'), + true, + 'Order should be valid because of Order Selection Question' + ); + return orderLine.validate(); + }) + .then(({ validations }) => { + assert.equal( + validations.get('isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + validations.get('isValid'), + true, + 'Order Line should be valid because of Order Selection Question' + ); + return orderSelection.validate(); + }) + .then(({ validations }) => { + assert.equal( + validations.get('isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + validations.get('isValid'), + true, + 'Order Selection should be valid because of Order Selection Question' + ); + return orderSelectionQuestion.validate(); + }) + .then(({ validations }) => { + assert.equal( + validations.get('isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + validations.get('isValid'), + true, + 'Order Selection Question should be valid' + ); + done(); + }); }); - assert.equal(order.get('lines.length'), 1, 'Order has 1 Order Line'); - assert.equal( - orderLine.get('selections.length'), - 1, - 'Order Line has 1 Order Selection' - ); - assert.equal( - orderSelection.get('questions.length'), - 1, - 'Order Selection has 1 Order Selection Question' - ); - - let done = assert.async(); - - order - .validate() - .then(({ validations }) => { - assert.equal( - validations.get('isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - validations.get('isValid'), - true, - 'Order should be valid because of Order Selection Question' - ); - return orderLine.validate(); - }) - .then(({ validations }) => { - assert.equal( - validations.get('isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - validations.get('isValid'), - true, - 'Order Line should be valid because of Order Selection Question' - ); - return orderSelection.validate(); - }) - .then(({ validations }) => { - assert.equal( - validations.get('isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - validations.get('isValid'), - true, - 'Order Selection should be valid because of Order Selection Question' - ); - return orderSelectionQuestion.validate(); - }) - .then(({ validations }) => { - assert.equal( - validations.get('isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - validations.get('isValid'), - true, - 'Order Selection Question should be valid' - ); - done(); + test('order with invalid question shows invalid if validated in reverse order', function(assert) { + assert.expect(11); + let order = run(() => + this.owner + .lookup('service:store') + .createRecord('order', { source: 'external' }) + ); + + let orderLine, orderSelection, orderSelectionQuestion; + + let store = this.owner.lookup('service:store'); + run(() => { + orderLine = store.createRecord('order-line', { order, type: 'item' }); + orderSelection = store.createRecord('order-selection', { + order, + line: orderLine, + quantity: 1 + }); + orderSelectionQuestion = store.createRecord('order-selection-question', { + order, + selection: orderSelection + }); }); -}); - -test('order with invalid question shows invalid if validated in reverse order', function(assert) { - assert.expect(11); - let order = this.subject({ source: 'external' }); - - let orderLine, orderSelection, orderSelectionQuestion; - let store = this.store(); - run(() => { - orderLine = store.createRecord('order-line', { order, type: 'item' }); - orderSelection = store.createRecord('order-selection', { - order, - line: orderLine, - quantity: 1 - }); - orderSelectionQuestion = store.createRecord('order-selection-question', { - order, - selection: orderSelection - }); + assert.equal(order.get('lines.length'), 1, 'Order has 1 Order Line'); + assert.equal( + orderLine.get('selections.length'), + 1, + 'Order Line has 1 Order Selection' + ); + assert.equal( + orderSelection.get('questions.length'), + 1, + 'Order Selection has 1 Order Selection Question' + ); + + let done = assert.async(); + + orderSelectionQuestion + .validate() + .then(({ validations }) => { + assert.equal( + validations.get('isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + validations.get('isValid'), + false, + 'Order Selection Question should not be valid' + ); + return orderSelection.validate(); + }) + .then(({ validations }) => { + assert.equal( + validations.get('isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + validations.get('isValid'), + false, + 'Order Selection should not be valid because of Order Selection Question' + ); + return orderLine.validate(); + }) + .then(({ validations }) => { + assert.equal( + validations.get('isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + validations.get('isValid'), + false, + 'Order Line should not be valid because of Order Selection Question' + ); + return order.validate(); + }) + .then(({ validations }) => { + assert.equal( + validations.get('isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + validations.get('isValid'), + false, + 'Order should not be valid because of Order Selection Question' + ); + done(); + }); }); - assert.equal(order.get('lines.length'), 1, 'Order has 1 Order Line'); - assert.equal( - orderLine.get('selections.length'), - 1, - 'Order Line has 1 Order Selection' - ); - assert.equal( - orderSelection.get('questions.length'), - 1, - 'Order Selection has 1 Order Selection Question' - ); - - let done = assert.async(); - - orderSelectionQuestion - .validate() - .then(({ validations }) => { - assert.equal( - validations.get('isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - validations.get('isValid'), - false, - 'Order Selection Question should not be valid' - ); - return orderSelection.validate(); - }) - .then(({ validations }) => { - assert.equal( - validations.get('isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - validations.get('isValid'), - false, - 'Order Selection should not be valid because of Order Selection Question' - ); - return orderLine.validate(); - }) - .then(({ validations }) => { - assert.equal( - validations.get('isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - validations.get('isValid'), - false, - 'Order Line should not be valid because of Order Selection Question' - ); - return order.validate(); - }) - .then(({ validations }) => { - assert.equal( - validations.get('isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - validations.get('isValid'), - false, - 'Order should not be valid because of Order Selection Question' - ); - done(); + test('order with valid question shows valid if validated in reverse order', function(assert) { + assert.expect(11); + let order = run(() => + this.owner + .lookup('service:store') + .createRecord('order', { source: 'external' }) + ); + + let orderLine, orderSelection, orderSelectionQuestion; + + let store = this.owner.lookup('service:store'); + run(() => { + orderLine = store.createRecord('order-line', { order, type: 'item' }); + orderSelection = store.createRecord('order-selection', { + order, + line: orderLine, + quantity: 1 + }); + orderSelectionQuestion = store.createRecord('order-selection-question', { + order, + selection: orderSelection, + text: 'answer' + }); }); -}); - -test('order with valid question shows valid if validated in reverse order', function(assert) { - assert.expect(11); - let order = this.subject({ source: 'external' }); - let orderLine, orderSelection, orderSelectionQuestion; - - let store = this.store(); - run(() => { - orderLine = store.createRecord('order-line', { order, type: 'item' }); - orderSelection = store.createRecord('order-selection', { - order, - line: orderLine, - quantity: 1 - }); - orderSelectionQuestion = store.createRecord('order-selection-question', { - order, - selection: orderSelection, - text: 'answer' - }); + assert.equal(order.get('lines.length'), 1, 'Order has 1 Order Line'); + assert.equal( + orderLine.get('selections.length'), + 1, + 'Order Line has 1 Order Selection' + ); + assert.equal( + orderSelection.get('questions.length'), + 1, + 'Order Selection has 1 Order Selection Question' + ); + + let done = assert.async(); + + orderSelectionQuestion + .validate() + .then(({ validations }) => { + assert.equal( + validations.get('isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + validations.get('isValid'), + true, + 'Order Selection Question should be valid' + ); + return orderSelection.validate(); + }) + .then(({ validations }) => { + assert.equal( + validations.get('isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + validations.get('isValid'), + true, + 'Order Selection should be valid because of Order Selection Question' + ); + return orderLine.validate(); + }) + .then(({ validations }) => { + assert.equal( + validations.get('isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + validations.get('isValid'), + true, + 'Order Line should be valid because of Order Selection Question' + ); + return order.validate(); + }) + .then(({ validations }) => { + assert.equal( + validations.get('isValidating'), + false, + 'All promises should be resolved' + ); + assert.equal( + validations.get('isValid'), + true, + 'Order should be valid because of Order Selection Question' + ); + done(); + }); }); - assert.equal(order.get('lines.length'), 1, 'Order has 1 Order Line'); - assert.equal( - orderLine.get('selections.length'), - 1, - 'Order Line has 1 Order Selection' - ); - assert.equal( - orderSelection.get('questions.length'), - 1, - 'Order Selection has 1 Order Selection Question' - ); - - let done = assert.async(); - - orderSelectionQuestion - .validate() - .then(({ validations }) => { - assert.equal( - validations.get('isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - validations.get('isValid'), - true, - 'Order Selection Question should be valid' - ); - return orderSelection.validate(); - }) - .then(({ validations }) => { - assert.equal( - validations.get('isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - validations.get('isValid'), - true, - 'Order Selection should be valid because of Order Selection Question' - ); - return orderLine.validate(); - }) - .then(({ validations }) => { - assert.equal( - validations.get('isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - validations.get('isValid'), - true, - 'Order Line should be valid because of Order Selection Question' - ); - return order.validate(); - }) - .then(({ validations }) => { - assert.equal( - validations.get('isValidating'), - false, - 'All promises should be resolved' - ); - assert.equal( - validations.get('isValid'), - true, - 'Order should be valid because of Order Selection Question' - ); - done(); + test('order with invalid question shows valid if invalid question is deleted in reverse order', function(assert) { + assert.expect(9); + let order = run(() => + this.owner + .lookup('service:store') + .createRecord('order', { id: 1, source: 'external' }) + ); + + let orderLine, + orderSelection, + orderSelectionQuestion, + orderSelectionQuestion2; + + let store = this.owner.lookup('service:store'); + run(() => { + let fakeSave = function(model) { + model.get('_internalModel').adapterWillCommit(); + model.get('_internalModel').adapterDidCommit(); + }; + + orderLine = store.createRecord('order-line', { + id: 1, + order, + type: 'item' + }); + orderSelection = store.createRecord('order-selection', { + id: 1, + order, + line: orderLine, + quantity: 1 + }); + orderSelectionQuestion = store.createRecord('order-selection-question', { + id: 1, + order, + selection: orderSelection, + text: 'answer' + }); + orderSelectionQuestion2 = store.createRecord('order-selection-question', { + id: 2, + order, + selection: orderSelection + }); + + fakeSave(order); + fakeSave(orderLine); + fakeSave(orderSelection); + fakeSave(orderSelectionQuestion); + fakeSave(orderSelectionQuestion2); }); -}); -test('order with invalid question shows valid if invalid question is deleted in reverse order', function(assert) { - assert.expect(9); - let order = this.subject({ id: 1, source: 'external' }); - - let orderLine, - orderSelection, - orderSelectionQuestion, - orderSelectionQuestion2; - - let store = this.store(); - run(() => { - let fakeSave = function(model) { - model.get('_internalModel').adapterWillCommit(); - model.get('_internalModel').adapterDidCommit(); - }; - - orderLine = store.createRecord('order-line', { - id: 1, - order, - type: 'item' - }); - orderSelection = store.createRecord('order-selection', { - id: 1, - order, - line: orderLine, - quantity: 1 - }); - orderSelectionQuestion = store.createRecord('order-selection-question', { - id: 1, - order, - selection: orderSelection, - text: 'answer' - }); - orderSelectionQuestion2 = store.createRecord('order-selection-question', { - id: 2, - order, - selection: orderSelection - }); - - fakeSave(order); - fakeSave(orderLine); - fakeSave(orderSelection); - fakeSave(orderSelectionQuestion); - fakeSave(orderSelectionQuestion2); + assert.equal(order.get('lines.length'), 1, 'Order has 1 Order Line'); + assert.equal( + orderLine.get('selections.length'), + 1, + 'Order Line has 1 Order Selection' + ); + assert.equal( + orderSelection.get('questions.length'), + 2, + 'Order Selection has 2 Order Selection Question' + ); + + let done = assert.async(); + + orderSelectionQuestion2 + .validate() + .then(({ validations }) => { + assert.equal( + validations.get('isValid'), + false, + 'Order Selection Question 2 should be invalid' + ); + + return orderSelectionQuestion.validate(); + }) + .then(({ validations }) => { + assert.equal( + validations.get('isValid'), + true, + 'Order Selection Question should be valid' + ); + + return orderSelection.validate(); + }) + .then(({ validations }) => { + assert.equal( + validations.get('isValid'), + false, + 'Order Selection should be invalid because of Order Selection Question 2' + ); + orderSelectionQuestion2.deleteRecord(); + + return orderSelection.validate(); + }) + .then(({ validations }) => { + assert.equal( + validations.get('isValid'), + true, + 'Order Selection should be valid because invalid Order Selection Question 2 was marked deleted' + ); + + orderSelectionQuestion.deleteRecord(); + return orderSelection.validate(); + }) + .then(() => { + assert.equal( + orderSelection.get('validations.attrs.questions.isValid'), + false, + 'Order Selection should not be valid because all Order Selection Questions have been marked deleted' + ); + + order.deleteRecord(); + return orderSelection.validate(); + }) + .then(() => { + assert.equal( + orderSelection.get('validations.attrs.order.isValid'), + false, + 'Order Selection should not be valid because Order was marked for deletion' + ); + + done(); + }); }); - - assert.equal(order.get('lines.length'), 1, 'Order has 1 Order Line'); - assert.equal( - orderLine.get('selections.length'), - 1, - 'Order Line has 1 Order Selection' - ); - assert.equal( - orderSelection.get('questions.length'), - 2, - 'Order Selection has 2 Order Selection Question' - ); - - let done = assert.async(); - - orderSelectionQuestion2 - .validate() - .then(({ validations }) => { - assert.equal( - validations.get('isValid'), - false, - 'Order Selection Question 2 should be invalid' - ); - - return orderSelectionQuestion.validate(); - }) - .then(({ validations }) => { - assert.equal( - validations.get('isValid'), - true, - 'Order Selection Question should be valid' - ); - - return orderSelection.validate(); - }) - .then(({ validations }) => { - assert.equal( - validations.get('isValid'), - false, - 'Order Selection should be invalid because of Order Selection Question 2' - ); - orderSelectionQuestion2.deleteRecord(); - - return orderSelection.validate(); - }) - .then(({ validations }) => { - assert.equal( - validations.get('isValid'), - true, - 'Order Selection should be valid because invalid Order Selection Question 2 was marked deleted' - ); - - orderSelectionQuestion.deleteRecord(); - return orderSelection.validate(); - }) - .then(() => { - assert.equal( - orderSelection.get('validations.attrs.questions.isValid'), - false, - 'Order Selection should not be valid because all Order Selection Questions have been marked deleted' - ); - - order.deleteRecord(); - return orderSelection.validate(); - }) - .then(() => { - assert.equal( - orderSelection.get('validations.attrs.order.isValid'), - false, - 'Order Selection should not be valid because Order was marked for deletion' - ); - - done(); - }); }); diff --git a/tests/unit/validators/base-test.js b/tests/unit/validators/base-test.js index e5ec2540..6b648ef8 100644 --- a/tests/unit/validators/base-test.js +++ b/tests/unit/validators/base-test.js @@ -2,126 +2,129 @@ import { htmlSafe } from '@ember/string'; import EmberObject from '@ember/object'; import { alias } from '@ember/object/computed'; import BaseValidator from 'ember-cp-validations/validators/base'; -import { moduleFor, test } from 'ember-qunit'; +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; +import setupObject from '../../helpers/setup-object'; let defaultOptions, options, validator, message; -moduleFor('validator:length', 'Unit | Validator | base', { - needs: ['validator:messages'], - setup() { - validator = BaseValidator.create(); - } -}); +module('Unit | Validator | base', function(hooks) { + setupTest(hooks); + + hooks.beforeEach(function() { + validator = setupObject(this, BaseValidator); + }); -test('buildOptions - merge all options', function(assert) { - assert.expect(1); + test('buildOptions - merge all options', function(assert) { + assert.expect(1); - options = { - foo: 'a' - }; + options = { + foo: 'a' + }; - defaultOptions = { - bar: 'b' - }; + defaultOptions = { + bar: 'b' + }; - options = validator.buildOptions(options, defaultOptions); - assert.deepEqual(options.getProperties(['foo', 'bar']), { - foo: 'a', - bar: 'b' + options = validator.buildOptions(options, defaultOptions); + assert.deepEqual(options.getProperties(['foo', 'bar']), { + foo: 'a', + bar: 'b' + }); }); -}); -test('buildOptions - does not overwrite options', function(assert) { - assert.expect(1); + test('buildOptions - does not overwrite options', function(assert) { + assert.expect(1); - options = { - foo: 'a', - bar: 'b' - }; + options = { + foo: 'a', + bar: 'b' + }; - defaultOptions = { - bar: 'c' - }; + defaultOptions = { + bar: 'c' + }; - options = validator.buildOptions(options, defaultOptions); - assert.deepEqual(options.getProperties(['foo', 'bar']), { - foo: 'a', - bar: 'b' + options = validator.buildOptions(options, defaultOptions); + assert.deepEqual(options.getProperties(['foo', 'bar']), { + foo: 'a', + bar: 'b' + }); }); -}); -test('buildOptions - toObject', function(assert) { - assert.expect(4); + test('buildOptions - toObject', function(assert) { + assert.expect(4); - options = validator.buildOptions({ - foo: alias('bar'), - bar: 'bar' - }); + options = validator.buildOptions({ + foo: alias('bar'), + bar: 'bar' + }); - assert.ok(options instanceof EmberObject); + assert.ok(options instanceof EmberObject); - let optionsObj = options.toObject(); + let optionsObj = options.toObject(); - assert.equal(typeof optionsObj, 'object'); - assert.notOk(optionsObj instanceof EmberObject); - assert.equal(optionsObj.foo, 'bar'); -}); + assert.equal(typeof optionsObj, 'object'); + assert.notOk(optionsObj instanceof EmberObject); + assert.equal(optionsObj.foo, 'bar'); + }); -test('createErrorMessage - message function', function(assert) { - assert.expect(1); + test('createErrorMessage - message function', function(assert) { + assert.expect(1); - options = { - message() { - return '{description} has some sort of error'; - } - }; + options = { + message() { + return '{description} has some sort of error'; + } + }; - message = validator.createErrorMessage(undefined, undefined, options); - assert.equal(message, 'This field has some sort of error'); -}); + message = validator.createErrorMessage(undefined, undefined, options); + assert.equal(message, 'This field has some sort of error'); + }); -test('value - default gets model value', function(assert) { - assert.expect(2); + test('value - default gets model value', function(assert) { + assert.expect(2); - validator.setProperties({ - model: EmberObject.create({ foo: 'bar' }), - attribute: 'foo', - options: {} - }); + validator.setProperties({ + model: EmberObject.create({ foo: 'bar' }), + attribute: 'foo', + options: {} + }); - validator.init(); + validator.init(); - assert.equal(validator.get('attribute'), 'foo'); - assert.equal(validator.getValue(), 'bar'); -}); + assert.equal(validator.get('attribute'), 'foo'); + assert.equal(validator.getValue(), 'bar'); + }); -test('value - overwrite value method via options', function(assert) { - assert.expect(3); + test('value - overwrite value method via options', function(assert) { + assert.expect(3); - validator.setProperties({ - model: EmberObject.create({ foo: 'bar', bar: 'baz' }), - attribute: 'foo', - options: { - value() { - return this.get('model.bar'); + validator.setProperties({ + model: EmberObject.create({ foo: 'bar', bar: 'baz' }), + attribute: 'foo', + options: { + value() { + return this.get('model.bar'); + } } - } - }); + }); - validator.init(); + validator.init(); - assert.equal(validator.get('attribute'), 'foo'); - assert.equal(validator.getValue(), 'baz'); - assert.notOk(validator.get('options.value')); -}); + assert.equal(validator.get('attribute'), 'foo'); + assert.equal(validator.getValue(), 'baz'); + assert.notOk(validator.get('options.value')); + }); -test('message - handles SafeString', function(assert) { - assert.expect(1); + test('message - handles SafeString', function(assert) { + assert.expect(1); - options = { - message: htmlSafe('should be more than €15') - }; + options = { + message: htmlSafe('should be more than €15') + }; - message = validator.createErrorMessage(undefined, undefined, options); - assert.equal(message, 'should be more than €15'); + message = validator.createErrorMessage(undefined, undefined, options); + assert.equal(message, 'should be more than €15'); + }); }); diff --git a/tests/unit/validators/collection-test.js b/tests/unit/validators/collection-test.js index efbebdc2..a94a9ea7 100644 --- a/tests/unit/validators/collection-test.js +++ b/tests/unit/validators/collection-test.js @@ -1,63 +1,65 @@ -import { moduleFor, test } from 'ember-qunit'; +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; let options, builtOptions, validator, message; -moduleFor('validator:collection', 'Unit | Validator | collection', { - needs: ['validator:messages'], - setup() { - validator = this.subject(); - } -}); +module('Unit | Validator | collection', function(hooks) { + setupTest(hooks); -test('buildOptions', function(assert) { - assert.expect(2); + hooks.beforeEach(function() { + validator = this.owner.lookup('validator:collection'); + }); - options = true; - builtOptions = validator.buildOptions(options, {}); + test('buildOptions', function(assert) { + assert.expect(2); - assert.equal(builtOptions.get('collection'), true); + options = true; + builtOptions = validator.buildOptions(options, {}); - options = { collection: true }; - builtOptions = validator.buildOptions(options, {}); - assert.equal(builtOptions.get('collection'), true); -}); + assert.equal(builtOptions.get('collection'), true); -test('value is collection', function(assert) { - assert.expect(1); + options = { collection: true }; + builtOptions = validator.buildOptions(options, {}); + assert.equal(builtOptions.get('collection'), true); + }); - options = { collection: true }; - builtOptions = validator.buildOptions(options); + test('value is collection', function(assert) { + assert.expect(1); - message = validator.validate(['foo', 'bar'], builtOptions.toObject()); - assert.equal(message, true); -}); + options = { collection: true }; + builtOptions = validator.buildOptions(options); -test('value not collection', function(assert) { - assert.expect(1); + message = validator.validate(['foo', 'bar'], builtOptions.toObject()); + assert.equal(message, true); + }); - options = { collection: true }; - builtOptions = validator.buildOptions(options); + test('value not collection', function(assert) { + assert.expect(1); - message = validator.validate('foo', builtOptions.toObject()); - assert.equal(message, 'This field must be a collection'); -}); + options = { collection: true }; + builtOptions = validator.buildOptions(options); -test('singular - value is singular', function(assert) { - assert.expect(1); + message = validator.validate('foo', builtOptions.toObject()); + assert.equal(message, 'This field must be a collection'); + }); - options = { collection: false }; - builtOptions = validator.buildOptions(options); + test('singular - value is singular', function(assert) { + assert.expect(1); - message = validator.validate('value', builtOptions.toObject()); - assert.equal(message, true); -}); + options = { collection: false }; + builtOptions = validator.buildOptions(options); + + message = validator.validate('value', builtOptions.toObject()); + assert.equal(message, true); + }); -test('singular - value not singular', function(assert) { - assert.expect(1); + test('singular - value not singular', function(assert) { + assert.expect(1); - options = { collection: false }; - builtOptions = validator.buildOptions(options); + options = { collection: false }; + builtOptions = validator.buildOptions(options); - message = validator.validate(['foo', 'bar'], builtOptions.toObject()); - assert.equal(message, "This field can't be a collection"); + message = validator.validate(['foo', 'bar'], builtOptions.toObject()); + assert.equal(message, "This field can't be a collection"); + }); }); diff --git a/tests/unit/validators/confirmation-test.js b/tests/unit/validators/confirmation-test.js index 0f65a27f..d42e7b90 100644 --- a/tests/unit/validators/confirmation-test.js +++ b/tests/unit/validators/confirmation-test.js @@ -1,30 +1,40 @@ import EmberObject from '@ember/object'; -import { moduleFor, test } from 'ember-qunit'; +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; let model, options, builtOptions, validator, message; -moduleFor('validator:confirmation', 'Unit | Validator | confirmation', { - needs: ['validator:messages'], - setup() { - validator = this.subject(); - } -}); +module('Unit | Validator | confirmation', function(hooks) { + setupTest(hooks); -test('attribute', function(assert) { - assert.expect(2); + hooks.beforeEach(function() { + validator = this.owner.lookup('validator:confirmation'); + }); - options = { on: 'email' }; - builtOptions = validator.buildOptions(options); + test('attribute', function(assert) { + assert.expect(2); - model = EmberObject.create({ - email: 'foo@gmail.com' - }); + options = { on: 'email' }; + builtOptions = validator.buildOptions(options); - message = validator.validate('bar@gmail.com', builtOptions.toObject(), model); - assert.equal(message, "This field doesn't match email"); + model = EmberObject.create({ + email: 'foo@gmail.com' + }); - model.set('emailConfirmation', 'foo@gmail.com'); + message = validator.validate( + 'bar@gmail.com', + builtOptions.toObject(), + model + ); + assert.equal(message, "This field doesn't match email"); - message = validator.validate('foo@gmail.com', builtOptions.toObject(), model); - assert.equal(message, true); + model.set('emailConfirmation', 'foo@gmail.com'); + + message = validator.validate( + 'foo@gmail.com', + builtOptions.toObject(), + model + ); + assert.equal(message, true); + }); }); diff --git a/tests/unit/validators/date-test.js b/tests/unit/validators/date-test.js index 019922b3..4ef3d15c 100644 --- a/tests/unit/validators/date-test.js +++ b/tests/unit/validators/date-test.js @@ -1,295 +1,313 @@ import moment from 'moment'; -import { moduleFor, test } from 'ember-qunit'; +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; let options, builtOptions, validator, message; -moduleFor('validator:date', 'Unit | Validator | date', { - needs: ['validator:messages'], - setup() { - validator = this.subject(); - } -}); - -test('no options', function(assert) { - assert.expect(1); - - options = {}; - message = validator.validate(undefined, options); - assert.equal(message, true); -}); - -test('allow blank', function(assert) { - assert.expect(2); - - options = { - allowBlank: true, - before: '1/1/2015' - }; +module('Unit | Validator | date', function(hooks) { + setupTest(hooks); - builtOptions = validator.buildOptions(options); + hooks.beforeEach(function() { + validator = this.owner.lookup('validator:date'); + }); - message = validator.validate('', builtOptions.toObject()); - assert.equal(message, true); + test('no options', function(assert) { + assert.expect(1); - message = validator.validate('1/1/2016', builtOptions.toObject()); - assert.equal(message, 'This field must be before Jan 1st, 2015'); -}); - -test('valid date', function(assert) { - assert.expect(2); + options = {}; + message = validator.validate(undefined, options); + assert.equal(message, true); + }); - options = {}; + test('allow blank', function(assert) { + assert.expect(2); - builtOptions = validator.buildOptions(options); + options = { + allowBlank: true, + before: '1/1/2015' + }; - message = validator.validate('abc', builtOptions.toObject()); - assert.equal(message, 'This field must be a valid date'); + builtOptions = validator.buildOptions(options); - message = validator.validate(new Date(), builtOptions.toObject()); - assert.equal(message, true); -}); + message = validator.validate('', builtOptions.toObject()); + assert.equal(message, true); -test('valid input date format', function(assert) { - assert.expect(2); + message = validator.validate('1/1/2016', builtOptions.toObject()); + assert.equal(message, 'This field must be before Jan 1st, 2015'); + }); - options = { - format: 'DD/M/YYYY' - }; + test('valid date', function(assert) { + assert.expect(2); - builtOptions = validator.buildOptions(options); + options = {}; - message = validator.validate('27/3/15', builtOptions.toObject()); - assert.equal(message, 'This field must be in the format of DD/M/YYYY'); + builtOptions = validator.buildOptions(options); - message = validator.validate('27/3/2015', builtOptions.toObject()); - assert.equal(message, true); -}); + message = validator.validate('abc', builtOptions.toObject()); + assert.equal(message, 'This field must be a valid date'); -test('error date format', function(assert) { - assert.expect(1); + message = validator.validate(new Date(), builtOptions.toObject()); + assert.equal(message, true); + }); - options = { - errorFormat: 'M/D/YYYY', - before: '1/1/2015' - }; + test('valid input date format', function(assert) { + assert.expect(2); - builtOptions = validator.buildOptions(options); + options = { + format: 'DD/M/YYYY' + }; - message = validator.validate('1/1/2016', builtOptions.toObject()); - assert.equal(message, 'This field must be before 1/1/2015'); -}); + builtOptions = validator.buildOptions(options); -test('before', function(assert) { - assert.expect(2); + message = validator.validate('27/3/15', builtOptions.toObject()); + assert.equal(message, 'This field must be in the format of DD/M/YYYY'); - options = { - before: '1/1/2015' - }; + message = validator.validate('27/3/2015', builtOptions.toObject()); + assert.equal(message, true); + }); - builtOptions = validator.buildOptions(options); + test('error date format', function(assert) { + assert.expect(1); - message = validator.validate('1/1/2016', builtOptions.toObject()); - assert.equal(message, 'This field must be before Jan 1st, 2015'); + options = { + errorFormat: 'M/D/YYYY', + before: '1/1/2015' + }; - message = validator.validate('1/1/2014', builtOptions.toObject()); - assert.equal(message, true); -}); + builtOptions = validator.buildOptions(options); -test('before now', function(assert) { - assert.expect(2); - let now = moment().format('MMM Do, YYYY'); - options = { - before: 'now' - }; + message = validator.validate('1/1/2016', builtOptions.toObject()); + assert.equal(message, 'This field must be before 1/1/2015'); + }); - builtOptions = validator.buildOptions(options); + test('before', function(assert) { + assert.expect(2); - message = validator.validate('1/1/3015', builtOptions.toObject()); - assert.equal(message, `This field must be before ${now}`); + options = { + before: '1/1/2015' + }; - message = validator.validate('1/1/2014', builtOptions.toObject()); - assert.equal(message, true); -}); + builtOptions = validator.buildOptions(options); -test('before or on', function(assert) { - assert.expect(3); + message = validator.validate('1/1/2016', builtOptions.toObject()); + assert.equal(message, 'This field must be before Jan 1st, 2015'); - options = { - onOrBefore: '1/1/2015' - }; + message = validator.validate('1/1/2014', builtOptions.toObject()); + assert.equal(message, true); + }); - builtOptions = validator.buildOptions(options); + test('before now', function(assert) { + assert.expect(2); + let now = moment().format('MMM Do, YYYY'); + options = { + before: 'now' + }; - message = validator.validate('1/1/2016', builtOptions.toObject()); - assert.equal(message, 'This field must be on or before Jan 1st, 2015'); + builtOptions = validator.buildOptions(options); - message = validator.validate('1/1/2014', builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate('1/1/3015', builtOptions.toObject()); + assert.equal(message, `This field must be before ${now}`); - message = validator.validate('1/1/2015', builtOptions.toObject()); - assert.equal(message, true); -}); + message = validator.validate('1/1/2014', builtOptions.toObject()); + assert.equal(message, true); + }); -test('before now or on', function(assert) { - assert.expect(3); - let now = moment().format('MMM Do, YYYY'); - options = { - onOrBefore: 'now' - }; + test('before or on', function(assert) { + assert.expect(3); - builtOptions = validator.buildOptions(options); + options = { + onOrBefore: '1/1/2015' + }; - message = validator.validate('1/1/3015', builtOptions.toObject()); - assert.equal(message, `This field must be on or before ${now}`); + builtOptions = validator.buildOptions(options); - message = validator.validate('1/1/2014', builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate('1/1/2016', builtOptions.toObject()); + assert.equal(message, 'This field must be on or before Jan 1st, 2015'); - message = validator.validate('now', builtOptions.toObject()); - assert.equal(message, true); -}); + message = validator.validate('1/1/2014', builtOptions.toObject()); + assert.equal(message, true); -test('before or on precision', function(assert) { - let precisions = ['second', 'minute', 'hour', 'day', 'week', 'month', 'year']; + message = validator.validate('1/1/2015', builtOptions.toObject()); + assert.equal(message, true); + }); - assert.expect(precisions.length * 3 - 1); - let now = moment(new Date('2013-02-08T09:30:26')); - let dateString = now.toString(); - let nowMessage = now.format('MMM Do, YYYY'); + test('before now or on', function(assert) { + assert.expect(3); + let now = moment().format('MMM Do, YYYY'); + options = { + onOrBefore: 'now' + }; - for (let i = 0; i < precisions.length; i++) { - let precision = precisions[i]; + builtOptions = validator.buildOptions(options); - builtOptions = validator.buildOptions({ onOrBefore: dateString }); + message = validator.validate('1/1/3015', builtOptions.toObject()); + assert.equal(message, `This field must be on or before ${now}`); - message = validator.validate(now, builtOptions.toObject()); + message = validator.validate('1/1/2014', builtOptions.toObject()); assert.equal(message, true); - message = validator.validate( - moment(now).add(1, precision), - builtOptions.toObject() - ); - assert.equal(message, `This field must be on or before ${nowMessage}`); - - if (i + 1 !== precisions.length) { - builtOptions = validator.buildOptions({ - onOrBefore: dateString, - precision: precisions[i + 1] - }); + message = validator.validate('now', builtOptions.toObject()); + assert.equal(message, true); + }); + + test('before or on precision', function(assert) { + let precisions = [ + 'second', + 'minute', + 'hour', + 'day', + 'week', + 'month', + 'year' + ]; + + assert.expect(precisions.length * 3 - 1); + let now = moment(new Date('2013-02-08T09:30:26')); + let dateString = now.toString(); + let nowMessage = now.format('MMM Do, YYYY'); + + for (let i = 0; i < precisions.length; i++) { + let precision = precisions[i]; + + builtOptions = validator.buildOptions({ onOrBefore: dateString }); + + message = validator.validate(now, builtOptions.toObject()); + assert.equal(message, true); message = validator.validate( - moment(now).add(1, precisions), + moment(now).add(1, precision), builtOptions.toObject() ); - assert.equal(message, true); + assert.equal(message, `This field must be on or before ${nowMessage}`); + + if (i + 1 !== precisions.length) { + builtOptions = validator.buildOptions({ + onOrBefore: dateString, + precision: precisions[i + 1] + }); + + message = validator.validate( + moment(now).add(1, precisions), + builtOptions.toObject() + ); + assert.equal(message, true); + } } - } -}); - -test('after', function(assert) { - assert.expect(2); + }); - options = { - after: '1/1/2015' - }; + test('after', function(assert) { + assert.expect(2); - builtOptions = validator.buildOptions(options); + options = { + after: '1/1/2015' + }; - message = validator.validate('1/1/2014', builtOptions.toObject()); - assert.equal(message, 'This field must be after Jan 1st, 2015'); + builtOptions = validator.buildOptions(options); - message = validator.validate('1/1/2016', builtOptions.toObject()); - assert.equal(message, true); -}); - -test('after now', function(assert) { - assert.expect(2); - let now = moment().format('MMM Do, YYYY'); - options = { - after: 'now' - }; - - builtOptions = validator.buildOptions(options); - - message = validator.validate('1/1/2014', builtOptions.toObject()); - assert.equal(message, `This field must be after ${now}`); - - message = validator.validate('1/1/3015', builtOptions.toObject()); - assert.equal(message, true); -}); + message = validator.validate('1/1/2014', builtOptions.toObject()); + assert.equal(message, 'This field must be after Jan 1st, 2015'); -test('after or on', function(assert) { - assert.expect(3); - - options = { - onOrAfter: '1/1/2015' - }; + message = validator.validate('1/1/2016', builtOptions.toObject()); + assert.equal(message, true); + }); - builtOptions = validator.buildOptions(options); + test('after now', function(assert) { + assert.expect(2); + let now = moment().format('MMM Do, YYYY'); + options = { + after: 'now' + }; - message = validator.validate('1/1/2014', builtOptions.toObject()); - assert.equal(message, 'This field must be on or after Jan 1st, 2015'); + builtOptions = validator.buildOptions(options); - message = validator.validate('1/1/2016', builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate('1/1/2014', builtOptions.toObject()); + assert.equal(message, `This field must be after ${now}`); - message = validator.validate('1/1/2015', builtOptions.toObject()); - assert.equal(message, true); -}); + message = validator.validate('1/1/3015', builtOptions.toObject()); + assert.equal(message, true); + }); -test('after now or on', function(assert) { - assert.expect(3); - let now = moment().format('MMM Do, YYYY'); - options = { - onOrAfter: 'now', - precision: 'second' - }; + test('after or on', function(assert) { + assert.expect(3); - builtOptions = validator.buildOptions(options); + options = { + onOrAfter: '1/1/2015' + }; - message = validator.validate('1/1/2014', builtOptions.toObject()); - assert.equal(message, `This field must be on or after ${now}`); + builtOptions = validator.buildOptions(options); - message = validator.validate('1/1/3015', builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate('1/1/2014', builtOptions.toObject()); + assert.equal(message, 'This field must be on or after Jan 1st, 2015'); - message = validator.validate('now', builtOptions.toObject()); - assert.equal(message, true); -}); + message = validator.validate('1/1/2016', builtOptions.toObject()); + assert.equal(message, true); -test('after or on precision', function(assert) { - let precisions = ['second', 'minute', 'hour', 'day', 'week', 'month', 'year']; + message = validator.validate('1/1/2015', builtOptions.toObject()); + assert.equal(message, true); + }); - assert.expect(precisions.length * 3 - 1); - let now = moment(new Date('2013-02-08T09:30:26')); - let dateString = now.toString(); - let nowMessage = now.format('MMM Do, YYYY'); + test('after now or on', function(assert) { + assert.expect(3); + let now = moment().format('MMM Do, YYYY'); + options = { + onOrAfter: 'now', + precision: 'second' + }; - for (let i = 0; i < precisions.length; i++) { - let precision = precisions[i]; + builtOptions = validator.buildOptions(options); - builtOptions = validator.buildOptions({ onOrAfter: dateString }); + message = validator.validate('1/1/2014', builtOptions.toObject()); + assert.equal(message, `This field must be on or after ${now}`); - message = validator.validate(now, builtOptions.toObject()); + message = validator.validate('1/1/3015', builtOptions.toObject()); assert.equal(message, true); - message = validator.validate( - moment(now).subtract(1, precision), - builtOptions.toObject() - ); - assert.equal(message, `This field must be on or after ${nowMessage}`); - - if (i + 1 !== precisions.length) { - builtOptions = validator.buildOptions({ - onOrAfter: dateString, - precision: precisions[i + 1] - }); + message = validator.validate('now', builtOptions.toObject()); + assert.equal(message, true); + }); + + test('after or on precision', function(assert) { + let precisions = [ + 'second', + 'minute', + 'hour', + 'day', + 'week', + 'month', + 'year' + ]; + + assert.expect(precisions.length * 3 - 1); + let now = moment(new Date('2013-02-08T09:30:26')); + let dateString = now.toString(); + let nowMessage = now.format('MMM Do, YYYY'); + + for (let i = 0; i < precisions.length; i++) { + let precision = precisions[i]; + + builtOptions = validator.buildOptions({ onOrAfter: dateString }); + + message = validator.validate(now, builtOptions.toObject()); + assert.equal(message, true); message = validator.validate( - moment(now).subtract(1, precisions), + moment(now).subtract(1, precision), builtOptions.toObject() ); - assert.equal(message, true); + assert.equal(message, `This field must be on or after ${nowMessage}`); + + if (i + 1 !== precisions.length) { + builtOptions = validator.buildOptions({ + onOrAfter: dateString, + precision: precisions[i + 1] + }); + + message = validator.validate( + moment(now).subtract(1, precisions), + builtOptions.toObject() + ); + assert.equal(message, true); + } } - } + }); }); diff --git a/tests/unit/validators/dependent-test.js b/tests/unit/validators/dependent-test.js index 32d9bbec..02a4b07c 100644 --- a/tests/unit/validators/dependent-test.js +++ b/tests/unit/validators/dependent-test.js @@ -1,6 +1,7 @@ import EmberObject, { get } from '@ember/object'; import { validator, buildValidations } from 'ember-cp-validations'; -import { test, moduleFor } from 'ember-qunit'; +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; import setupObject from '../../helpers/setup-object'; let Validator, message, model, options, builtOptions; @@ -14,79 +15,80 @@ let defaultOptions = { on: ['firstName', 'lastName'] }; -moduleFor('validator:dependent', 'Unit | Validator | dependent', { - needs: ['validator:messages', 'validator:presence'], - setup() { - Validator = this.subject(); - } -}); - -test('no options', function(assert) { - assert.expect(1); - - builtOptions = Validator.buildOptions({}).toObject(); +module('Unit | Validator | dependent', function(hooks) { + setupTest(hooks); - try { - message = Validator.validate(undefined, builtOptions); - } catch (e) { - assert.ok(true); - } -}); + hooks.beforeEach(function() { + Validator = this.owner.lookup('validator:dependent'); + }); -test('all empty attributes', function(assert) { - assert.expect(5); + test('no options', function(assert) { + assert.expect(1); - options = defaultOptions; - builtOptions = Validator.buildOptions(options); + builtOptions = Validator.buildOptions({}).toObject(); - model = setupObject(this, EmberObject.extend(Validations)); + try { + message = Validator.validate(undefined, builtOptions); + } catch (e) { + assert.ok(true); + } + }); - assert.equal(get(model, 'validations.isValid'), false); - assert.equal(get(model, 'validations.isDirty'), false); + test('all empty attributes', function(assert) { + assert.expect(5); - message = Validator.validate(undefined, builtOptions.toObject(), model); + options = defaultOptions; + builtOptions = Validator.buildOptions(options); - assert.equal(message, 'This field is invalid'); - assert.equal(get(model, 'validations.messages.length'), 1); - assert.equal(get(model, 'validations.isValid'), false); -}); + model = setupObject(this, EmberObject.extend(Validations)); -test('one dependent error', function(assert) { - assert.expect(5); + assert.equal(get(model, 'validations.isValid'), false); + assert.equal(get(model, 'validations.isDirty'), false); - options = defaultOptions; - builtOptions = Validator.buildOptions(options); + message = Validator.validate(undefined, builtOptions.toObject(), model); - model = setupObject(this, EmberObject.extend(Validations), { - firstName: 'Offir' + assert.equal(message, 'This field is invalid'); + assert.equal(get(model, 'validations.messages.length'), 1); + assert.equal(get(model, 'validations.isValid'), false); }); - assert.equal(get(model, 'validations.isValid'), false); - assert.equal(get(model, 'validations.isDirty'), true); + test('one dependent error', function(assert) { + assert.expect(5); - message = Validator.validate(undefined, builtOptions.toObject(), model); + options = defaultOptions; + builtOptions = Validator.buildOptions(options); - assert.equal(message, 'This field is invalid'); - assert.equal(get(model, 'validations.messages.length'), 1); - assert.equal(get(model, 'validations.isValid'), false); -}); + model = setupObject(this, EmberObject.extend(Validations), { + firstName: 'Offir' + }); + + assert.equal(get(model, 'validations.isValid'), false); + assert.equal(get(model, 'validations.isDirty'), true); -test('no dependent errors', function(assert) { - assert.expect(5); - options = defaultOptions; - builtOptions = Validator.buildOptions(options); + message = Validator.validate(undefined, builtOptions.toObject(), model); - model = setupObject(this, EmberObject.extend(Validations), { - firstName: 'Offir', - lastName: 'Golan' + assert.equal(message, 'This field is invalid'); + assert.equal(get(model, 'validations.messages.length'), 1); + assert.equal(get(model, 'validations.isValid'), false); }); - assert.equal(get(model, 'validations.isValid'), true); - assert.equal(get(model, 'validations.isDirty'), true); + test('no dependent errors', function(assert) { + assert.expect(5); + options = defaultOptions; + builtOptions = Validator.buildOptions(options); - message = Validator.validate(undefined, builtOptions.toObject(), model); + model = setupObject(this, EmberObject.extend(Validations), { + firstName: 'Offir', + lastName: 'Golan' + }); - assert.equal(message, true); - assert.equal(get(model, 'validations.messages.length'), 0); - assert.equal(get(model, 'validations.isValid'), true); + assert.equal(get(model, 'validations.isValid'), true); + assert.equal(get(model, 'validations.isDirty'), true); + + message = Validator.validate(undefined, builtOptions.toObject(), model); + + assert.equal(message, true); + assert.equal(get(model, 'validations.messages.length'), 0); + assert.equal(get(model, 'validations.isValid'), true); + }); }); diff --git a/tests/unit/validators/ds-error-test.js b/tests/unit/validators/ds-error-test.js index 62ef2e79..2f9c2e52 100644 --- a/tests/unit/validators/ds-error-test.js +++ b/tests/unit/validators/ds-error-test.js @@ -1,56 +1,58 @@ import EmberObject from '@ember/object'; import DS from 'ember-data'; -import { moduleFor, test } from 'ember-qunit'; +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; let model, validator, message; -moduleFor('validator:ds-error', 'Unit | Validator | ds-error', { - needs: ['validator:messages'], - setup() { - validator = this.subject(); - } -}); - -test('works with empty object', function(assert) { - assert.expect(1); +module('Unit | Validator | ds-error', function(hooks) { + setupTest(hooks); - model = EmberObject.create(); + hooks.beforeEach(function() { + validator = this.owner.lookup('validator:ds-error'); + }); - message = validator.validate(undefined, undefined, model, 'username'); - assert.equal(message, true); -}); + test('works with empty object', function(assert) { + assert.expect(1); -test('it works', function(assert) { - assert.expect(2); + model = EmberObject.create(); - model = EmberObject.create({ - errors: DS.Errors.create(), - username: null + message = validator.validate(undefined, undefined, model, 'username'); + assert.equal(message, true); }); - message = validator.validate(undefined, undefined, model, 'username'); - assert.equal(message, true); + test('it works', function(assert) { + assert.expect(2); - model.get('errors').add('username', 'Username is not unique'); + model = EmberObject.create({ + errors: DS.Errors.create(), + username: null + }); - message = validator.validate(undefined, undefined, model, 'username'); - assert.equal(message, 'Username is not unique'); -}); + message = validator.validate(undefined, undefined, model, 'username'); + assert.equal(message, true); -test('gets last message', function(assert) { - assert.expect(2); + model.get('errors').add('username', 'Username is not unique'); - model = EmberObject.create({ - errors: DS.Errors.create(), - username: null + message = validator.validate(undefined, undefined, model, 'username'); + assert.equal(message, 'Username is not unique'); }); - message = validator.validate(undefined, undefined, model, 'username'); - assert.equal(message, true); + test('gets last message', function(assert) { + assert.expect(2); + + model = EmberObject.create({ + errors: DS.Errors.create(), + username: null + }); - model.get('errors').add('username', 'Username is not unique'); - model.get('errors').add('username', 'Username is too long'); + message = validator.validate(undefined, undefined, model, 'username'); + assert.equal(message, true); - message = validator.validate(undefined, undefined, model, 'username'); - assert.equal(message, 'Username is too long'); + model.get('errors').add('username', 'Username is not unique'); + model.get('errors').add('username', 'Username is too long'); + + message = validator.validate(undefined, undefined, model, 'username'); + assert.equal(message, 'Username is too long'); + }); }); diff --git a/tests/unit/validators/exclusion-test.js b/tests/unit/validators/exclusion-test.js index e5f5f72b..7f3a3e9a 100644 --- a/tests/unit/validators/exclusion-test.js +++ b/tests/unit/validators/exclusion-test.js @@ -1,130 +1,132 @@ -import { moduleFor, test } from 'ember-qunit'; +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; let options, builtOptions, validator, message; -moduleFor('validator:exclusion', 'Unit | Validator | exclusion', { - needs: ['validator:messages'], - setup() { - validator = this.subject(); - } -}); +module('Unit | Validator | exclusion', function(hooks) { + setupTest(hooks); -test('no options', function(assert) { - assert.expect(1); + hooks.beforeEach(function() { + validator = this.owner.lookup('validator:exclusion'); + }); - builtOptions = validator.buildOptions({}).toObject(); + test('no options', function(assert) { + assert.expect(1); - try { - message = validator.validate(undefined, builtOptions); - } catch (e) { - assert.ok(true); - } -}); + builtOptions = validator.buildOptions({}).toObject(); -test('allow blank', function(assert) { - assert.expect(2); + try { + message = validator.validate(undefined, builtOptions); + } catch (e) { + assert.ok(true); + } + }); - options = { - allowBlank: true, - in: ['foo', 'bar', 'baz'] - }; + test('allow blank', function(assert) { + assert.expect(2); - builtOptions = validator.buildOptions(options); + options = { + allowBlank: true, + in: ['foo', 'bar', 'baz'] + }; - message = validator.validate('', builtOptions.toObject()); - assert.equal(message, true); + builtOptions = validator.buildOptions(options); - message = validator.validate('foo', builtOptions.toObject()); - assert.equal(message, 'This field is reserved'); -}); + message = validator.validate('', builtOptions.toObject()); + assert.equal(message, true); -test('not in array', function(assert) { - assert.expect(4); + message = validator.validate('foo', builtOptions.toObject()); + assert.equal(message, 'This field is reserved'); + }); - options = { - in: ['foo', 'bar', 'baz'] - }; + test('not in array', function(assert) { + assert.expect(4); - builtOptions = validator.buildOptions(options); + options = { + in: ['foo', 'bar', 'baz'] + }; - message = validator.validate('foo', builtOptions.toObject()); - assert.equal(message, 'This field is reserved'); + builtOptions = validator.buildOptions(options); - message = validator.validate('bar', builtOptions.toObject()); - assert.equal(message, 'This field is reserved'); + message = validator.validate('foo', builtOptions.toObject()); + assert.equal(message, 'This field is reserved'); - message = validator.validate('baz', builtOptions.toObject()); - assert.equal(message, 'This field is reserved'); + message = validator.validate('bar', builtOptions.toObject()); + assert.equal(message, 'This field is reserved'); - message = validator.validate('test', builtOptions.toObject()); - assert.equal(message, true); -}); + message = validator.validate('baz', builtOptions.toObject()); + assert.equal(message, 'This field is reserved'); -test('not in range', function(assert) { - assert.expect(5); + message = validator.validate('test', builtOptions.toObject()); + assert.equal(message, true); + }); - options = { - range: [1, 10] - }; + test('not in range', function(assert) { + assert.expect(5); - builtOptions = validator.buildOptions(options); + options = { + range: [1, 10] + }; - message = validator.validate(1, builtOptions.toObject()); - assert.equal(message, 'This field is reserved'); + builtOptions = validator.buildOptions(options); - message = validator.validate(5, builtOptions.toObject()); - assert.equal(message, 'This field is reserved'); + message = validator.validate(1, builtOptions.toObject()); + assert.equal(message, 'This field is reserved'); - message = validator.validate(10, builtOptions.toObject()); - assert.equal(message, 'This field is reserved'); + message = validator.validate(5, builtOptions.toObject()); + assert.equal(message, 'This field is reserved'); - message = validator.validate(0, builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate(10, builtOptions.toObject()); + assert.equal(message, 'This field is reserved'); - message = validator.validate(100, builtOptions.toObject()); - assert.equal(message, true); -}); + message = validator.validate(0, builtOptions.toObject()); + assert.equal(message, true); -test('range type check - number', function(assert) { - assert.expect(4); + message = validator.validate(100, builtOptions.toObject()); + assert.equal(message, true); + }); - options = { - range: [1, 10] - }; + test('range type check - number', function(assert) { + assert.expect(4); - builtOptions = validator.buildOptions(options); + options = { + range: [1, 10] + }; - message = validator.validate(1, builtOptions.toObject()); - assert.equal(message, 'This field is reserved'); + builtOptions = validator.buildOptions(options); - message = validator.validate(5, builtOptions.toObject()); - assert.equal(message, 'This field is reserved'); + message = validator.validate(1, builtOptions.toObject()); + assert.equal(message, 'This field is reserved'); - message = validator.validate('1', builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate(5, builtOptions.toObject()); + assert.equal(message, 'This field is reserved'); - message = validator.validate('5', builtOptions.toObject()); - assert.equal(message, true); -}); + message = validator.validate('1', builtOptions.toObject()); + assert.equal(message, true); + + message = validator.validate('5', builtOptions.toObject()); + assert.equal(message, true); + }); -test('range type check - string', function(assert) { - assert.expect(4); + test('range type check - string', function(assert) { + assert.expect(4); - options = { - range: ['a', 'z'] - }; + options = { + range: ['a', 'z'] + }; - builtOptions = validator.buildOptions(options); + builtOptions = validator.buildOptions(options); - message = validator.validate('a', builtOptions.toObject()); - assert.equal(message, 'This field is reserved'); + message = validator.validate('a', builtOptions.toObject()); + assert.equal(message, 'This field is reserved'); - message = validator.validate('z', builtOptions.toObject()); - assert.equal(message, 'This field is reserved'); + message = validator.validate('z', builtOptions.toObject()); + assert.equal(message, 'This field is reserved'); - message = validator.validate(97, builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate(97, builtOptions.toObject()); + assert.equal(message, true); - message = validator.validate('zzz', builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate('zzz', builtOptions.toObject()); + assert.equal(message, true); + }); }); diff --git a/tests/unit/validators/format-test.js b/tests/unit/validators/format-test.js index aa1bf366..ba95e3de 100644 --- a/tests/unit/validators/format-test.js +++ b/tests/unit/validators/format-test.js @@ -1,213 +1,215 @@ -import { moduleFor, test } from 'ember-qunit'; +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; let options, builtOptions, validator, message; -moduleFor('validator:format', 'Unit | Validator | format', { - needs: ['validator:messages'], - setup() { - validator = this.subject(); - } -}); - -test('no options', function(assert) { - assert.expect(1); - - builtOptions = validator.buildOptions({}).toObject(); - - try { - message = validator.validate(undefined, builtOptions); - } catch (e) { - assert.ok(true); - } -}); - -test('allow blank', function(assert) { - assert.expect(2); - - options = { - allowBlank: true, - type: 'email' - }; - options = validator.buildOptions(options, {}).toObject(); - - message = validator.validate(undefined, options); - assert.equal(message, true); - - message = validator.validate('email', options); - assert.equal(message, 'This field must be a valid email address'); -}); - -test('email no option', function(assert) { - let validAddresses = [ - 'email@domain.com', - 'firstname.lastname@domain.com', - 'email@subdomain.domain.com', - 'firstname+lastname@domain.com', - '1234567890@domain.com', - 'email@domain-one.com', - '_______@domain.com', - 'email@domain.name', - 'email@domain.co.jp', - 'firstname-lastname@domain.com', - 'EMAIL@DOMAIN.COM' - ]; - let invalidAddresses = [ - 'plainaddress', - '#@%^%#$@#$@#.com', - '@domain.com', - 'Joe Smith ', - 'email.domain.com', - 'email@domain@domain.com', - '.email@domain.com', - 'email.@domain.com', - 'email..email@domain.com', - 'あいうえお@domain.com', - 'email@domain.com (Joe Smith)', - 'email@domain', - 'email@domain.', - 'email@domain.-', - 'email@domain-', - 'email@domain-.', - 'email@domain.com.', - 'email@domain.com.-', - 'email@domain.com-', - 'email@domain.com-.', - 'email@-domain.com', - 'email@domain..com' - ]; - - assert.expect(validAddresses.length + invalidAddresses.length); - - options = { - type: 'email' - }; - - options = validator.buildOptions(options, {}).toObject(); - - validAddresses.forEach(email => - assert.equal( - validator.validate(email, options), - true, - `validation of ${email} must succeed` - ) - ); - invalidAddresses.forEach(email => - assert.equal( - validator.validate(email, options), - 'This field must be a valid email address', - `validation of ${email} must fail` - ) - ); -}); - -test('email option allowNonTld', function(assert) { - let validAddresses = [ - 'email@domain.com', - 'firstname.lastname@domain.com', - 'email@subdomain.domain.com', - 'firstname+lastname@domain.com', - '1234567890@domain.com', - 'email@domain-one.com', - '_______@domain.com', - 'email@domain.name', - 'email@domain.co.jp', - 'firstname-lastname@domain.com', - 'EMAIL@DOMAIN.COM', - 'email@domain' - ]; - let invalidAddresses = [ - 'plainaddress', - '#@%^%#$@#$@#.com', - '@domain.com', - 'Joe Smith ', - 'email.domain.com', - 'email@domain@domain.com', - '.email@domain.com', - 'email.@domain.com', - 'email..email@domain.com', - 'あいうえお@domain.com', - 'email@domain.com (Joe Smith)', - 'email@domain.', - 'email@domain.-', - 'email@domain-', - 'email@domain-.', - 'email@domain.com.', - 'email@domain.com.-', - 'email@domain.com-', - 'email@domain.com-.', - 'email@-domain.com', - 'email@domain..com' - ]; - - assert.expect(validAddresses.length + invalidAddresses.length); - - options = { - type: 'email', - allowNonTld: true - }; - - options = validator.buildOptions(options, {}).toObject(); - - validAddresses.forEach(email => - assert.equal( - validator.validate(email, options), - true, - `validation of ${email} must succeed` - ) - ); - invalidAddresses.forEach(email => - assert.equal( - validator.validate(email, options), - 'This field must be a valid email address', - `validation of ${email} must fail` - ) - ); -}); - -test('phone', function(assert) { - assert.expect(2); - - options = { - type: 'phone' - }; - - options = validator.buildOptions(options, {}).toObject(); - - message = validator.validate('123', options); - assert.equal(message, 'This field must be a valid phone number'); - - message = validator.validate('(408) 555-1234', options); - assert.equal(message, true); -}); - -test('url', function(assert) { - assert.expect(2); - - options = { - type: 'url' - }; - - options = validator.buildOptions(options, {}).toObject(); - - message = validator.validate('offirgolan', options); - assert.equal(message, 'This field must be a valid url'); - - message = validator.validate('http://www.offirgolan.com', options); - assert.equal(message, true); -}); - -test('custom', function(assert) { - assert.expect(2); - - options = { - regex: /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{4,8}$/ - }; - - options = validator.buildOptions(options, {}).toObject(); - - message = validator.validate('password', options); - assert.equal(message, 'This field is invalid'); - - message = validator.validate('Pass123', options); - assert.equal(message, true); +module('Unit | Validator | format', function(hooks) { + setupTest(hooks); + + hooks.beforeEach(function() { + validator = this.owner.lookup('validator:format'); + }); + + test('no options', function(assert) { + assert.expect(1); + + builtOptions = validator.buildOptions({}).toObject(); + + try { + message = validator.validate(undefined, builtOptions); + } catch (e) { + assert.ok(true); + } + }); + + test('allow blank', function(assert) { + assert.expect(2); + + options = { + allowBlank: true, + type: 'email' + }; + options = validator.buildOptions(options, {}).toObject(); + + message = validator.validate(undefined, options); + assert.equal(message, true); + + message = validator.validate('email', options); + assert.equal(message, 'This field must be a valid email address'); + }); + + test('email no option', function(assert) { + let validAddresses = [ + 'email@domain.com', + 'firstname.lastname@domain.com', + 'email@subdomain.domain.com', + 'firstname+lastname@domain.com', + '1234567890@domain.com', + 'email@domain-one.com', + '_______@domain.com', + 'email@domain.name', + 'email@domain.co.jp', + 'firstname-lastname@domain.com', + 'EMAIL@DOMAIN.COM' + ]; + let invalidAddresses = [ + 'plainaddress', + '#@%^%#$@#$@#.com', + '@domain.com', + 'Joe Smith ', + 'email.domain.com', + 'email@domain@domain.com', + '.email@domain.com', + 'email.@domain.com', + 'email..email@domain.com', + 'あいうえお@domain.com', + 'email@domain.com (Joe Smith)', + 'email@domain', + 'email@domain.', + 'email@domain.-', + 'email@domain-', + 'email@domain-.', + 'email@domain.com.', + 'email@domain.com.-', + 'email@domain.com-', + 'email@domain.com-.', + 'email@-domain.com', + 'email@domain..com' + ]; + + assert.expect(validAddresses.length + invalidAddresses.length); + + options = { + type: 'email' + }; + + options = validator.buildOptions(options, {}).toObject(); + + validAddresses.forEach(email => + assert.equal( + validator.validate(email, options), + true, + `validation of ${email} must succeed` + ) + ); + invalidAddresses.forEach(email => + assert.equal( + validator.validate(email, options), + 'This field must be a valid email address', + `validation of ${email} must fail` + ) + ); + }); + + test('email option allowNonTld', function(assert) { + let validAddresses = [ + 'email@domain.com', + 'firstname.lastname@domain.com', + 'email@subdomain.domain.com', + 'firstname+lastname@domain.com', + '1234567890@domain.com', + 'email@domain-one.com', + '_______@domain.com', + 'email@domain.name', + 'email@domain.co.jp', + 'firstname-lastname@domain.com', + 'EMAIL@DOMAIN.COM', + 'email@domain' + ]; + let invalidAddresses = [ + 'plainaddress', + '#@%^%#$@#$@#.com', + '@domain.com', + 'Joe Smith ', + 'email.domain.com', + 'email@domain@domain.com', + '.email@domain.com', + 'email.@domain.com', + 'email..email@domain.com', + 'あいうえお@domain.com', + 'email@domain.com (Joe Smith)', + 'email@domain.', + 'email@domain.-', + 'email@domain-', + 'email@domain-.', + 'email@domain.com.', + 'email@domain.com.-', + 'email@domain.com-', + 'email@domain.com-.', + 'email@-domain.com', + 'email@domain..com' + ]; + + assert.expect(validAddresses.length + invalidAddresses.length); + + options = { + type: 'email', + allowNonTld: true + }; + + options = validator.buildOptions(options, {}).toObject(); + + validAddresses.forEach(email => + assert.equal( + validator.validate(email, options), + true, + `validation of ${email} must succeed` + ) + ); + invalidAddresses.forEach(email => + assert.equal( + validator.validate(email, options), + 'This field must be a valid email address', + `validation of ${email} must fail` + ) + ); + }); + + test('phone', function(assert) { + assert.expect(2); + + options = { + type: 'phone' + }; + + options = validator.buildOptions(options, {}).toObject(); + + message = validator.validate('123', options); + assert.equal(message, 'This field must be a valid phone number'); + + message = validator.validate('(408) 555-1234', options); + assert.equal(message, true); + }); + + test('url', function(assert) { + assert.expect(2); + + options = { + type: 'url' + }; + + options = validator.buildOptions(options, {}).toObject(); + + message = validator.validate('offirgolan', options); + assert.equal(message, 'This field must be a valid url'); + + message = validator.validate('http://www.offirgolan.com', options); + assert.equal(message, true); + }); + + test('custom', function(assert) { + assert.expect(2); + + options = { + regex: /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{4,8}$/ + }; + + options = validator.buildOptions(options, {}).toObject(); + + message = validator.validate('password', options); + assert.equal(message, 'This field is invalid'); + + message = validator.validate('Pass123', options); + assert.equal(message, true); + }); }); diff --git a/tests/unit/validators/inclusion-test.js b/tests/unit/validators/inclusion-test.js index 2ee83f70..5d69ed44 100644 --- a/tests/unit/validators/inclusion-test.js +++ b/tests/unit/validators/inclusion-test.js @@ -1,137 +1,139 @@ -import { moduleFor, test } from 'ember-qunit'; +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; let options, builtOptions, validator, message; -moduleFor('validator:inclusion', 'Unit | Validator | inclusion', { - needs: ['validator:messages'], - setup() { - validator = this.subject(); - } -}); +module('Unit | Validator | inclusion', function(hooks) { + setupTest(hooks); -test('no options', function(assert) { - assert.expect(1); + hooks.beforeEach(function() { + validator = this.owner.lookup('validator:inclusion'); + }); - builtOptions = validator.buildOptions({}).toObject(); + test('no options', function(assert) { + assert.expect(1); - try { - message = validator.validate(undefined, builtOptions); - } catch (e) { - assert.ok(true); - } -}); + builtOptions = validator.buildOptions({}).toObject(); -test('allow blank', function(assert) { - assert.expect(2); + try { + message = validator.validate(undefined, builtOptions); + } catch (e) { + assert.ok(true); + } + }); - options = { - allowBlank: true, - in: ['foo', 'bar', 'baz'] - }; - builtOptions = validator.buildOptions(options); + test('allow blank', function(assert) { + assert.expect(2); - message = validator.validate('', builtOptions.toObject()); - assert.equal(message, true); + options = { + allowBlank: true, + in: ['foo', 'bar', 'baz'] + }; + builtOptions = validator.buildOptions(options); - message = validator.validate('test', builtOptions.toObject()); - assert.equal(message, 'This field is not included in the list'); -}); + message = validator.validate('', builtOptions.toObject()); + assert.equal(message, true); -test('in array', function(assert) { - assert.expect(4); + message = validator.validate('test', builtOptions.toObject()); + assert.equal(message, 'This field is not included in the list'); + }); - options = { - in: ['foo', 'bar', 'baz'] - }; - builtOptions = validator.buildOptions(options); + test('in array', function(assert) { + assert.expect(4); - message = validator.validate('test', builtOptions.toObject()); - assert.equal(message, 'This field is not included in the list'); + options = { + in: ['foo', 'bar', 'baz'] + }; + builtOptions = validator.buildOptions(options); - message = validator.validate('foo', builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate('test', builtOptions.toObject()); + assert.equal(message, 'This field is not included in the list'); - message = validator.validate('bar', builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate('foo', builtOptions.toObject()); + assert.equal(message, true); - message = validator.validate('baz', builtOptions.toObject()); - assert.equal(message, true); -}); + message = validator.validate('bar', builtOptions.toObject()); + assert.equal(message, true); -test('in range', function(assert) { - assert.expect(5); + message = validator.validate('baz', builtOptions.toObject()); + assert.equal(message, true); + }); - options = { - range: [1, 10] - }; - builtOptions = validator.buildOptions(options); + test('in range', function(assert) { + assert.expect(5); - message = validator.validate(0, builtOptions.toObject()); - assert.equal(message, 'This field is not included in the list'); + options = { + range: [1, 10] + }; + builtOptions = validator.buildOptions(options); - message = validator.validate(100, builtOptions.toObject()); - assert.equal(message, 'This field is not included in the list'); + message = validator.validate(0, builtOptions.toObject()); + assert.equal(message, 'This field is not included in the list'); - message = validator.validate(1, builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate(100, builtOptions.toObject()); + assert.equal(message, 'This field is not included in the list'); - message = validator.validate(5, builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate(1, builtOptions.toObject()); + assert.equal(message, true); - message = validator.validate(10, builtOptions.toObject()); - assert.equal(message, true); -}); + message = validator.validate(5, builtOptions.toObject()); + assert.equal(message, true); -test('range type check - number', function(assert) { - assert.expect(7); + message = validator.validate(10, builtOptions.toObject()); + assert.equal(message, true); + }); - options = { - range: [1, 10] - }; - builtOptions = validator.buildOptions(options); + test('range type check - number', function(assert) { + assert.expect(7); - message = validator.validate('0', builtOptions.toObject()); - assert.equal(message, 'This field is not included in the list'); + options = { + range: [1, 10] + }; + builtOptions = validator.buildOptions(options); - message = validator.validate(0, builtOptions.toObject()); - assert.equal(message, 'This field is not included in the list'); + message = validator.validate('0', builtOptions.toObject()); + assert.equal(message, 'This field is not included in the list'); - message = validator.validate('1', builtOptions.toObject()); - assert.equal(message, 'This field is not included in the list'); + message = validator.validate(0, builtOptions.toObject()); + assert.equal(message, 'This field is not included in the list'); - message = validator.validate('5', builtOptions.toObject()); - assert.equal(message, 'This field is not included in the list'); + message = validator.validate('1', builtOptions.toObject()); + assert.equal(message, 'This field is not included in the list'); - message = validator.validate(1, builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate('5', builtOptions.toObject()); + assert.equal(message, 'This field is not included in the list'); - message = validator.validate(5, builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate(1, builtOptions.toObject()); + assert.equal(message, true); - message = validator.validate(10, builtOptions.toObject()); - assert.equal(message, true); -}); + message = validator.validate(5, builtOptions.toObject()); + assert.equal(message, true); + + message = validator.validate(10, builtOptions.toObject()); + assert.equal(message, true); + }); -test('range type check - string', function(assert) { - assert.expect(5); + test('range type check - string', function(assert) { + assert.expect(5); - options = { - range: ['a', 'z'] - }; - builtOptions = validator.buildOptions(options); + options = { + range: ['a', 'z'] + }; + builtOptions = validator.buildOptions(options); - message = validator.validate(97, builtOptions.toObject()); - assert.equal(message, 'This field is not included in the list'); + message = validator.validate(97, builtOptions.toObject()); + assert.equal(message, 'This field is not included in the list'); - message = validator.validate('zzz', builtOptions.toObject()); - assert.equal(message, 'This field is not included in the list'); + message = validator.validate('zzz', builtOptions.toObject()); + assert.equal(message, 'This field is not included in the list'); - message = validator.validate('a', builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate('a', builtOptions.toObject()); + assert.equal(message, true); - message = validator.validate('o', builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate('o', builtOptions.toObject()); + assert.equal(message, true); - message = validator.validate('z', builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate('z', builtOptions.toObject()); + assert.equal(message, true); + }); }); diff --git a/tests/unit/validators/inline-test.js b/tests/unit/validators/inline-test.js index fe8cb95c..f46d3a1d 100644 --- a/tests/unit/validators/inline-test.js +++ b/tests/unit/validators/inline-test.js @@ -1,30 +1,36 @@ -import { moduleFor, test } from 'ember-qunit'; +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; -moduleFor('validator:inline', 'Unit | Validator | inline'); +module('Unit | Validator | inline', function(hooks) { + setupTest(hooks); -test('no options', function(assert) { - assert.expect(1); + test('no options', function(assert) { + assert.expect(1); - try { - this.subject(); - } catch (e) { - assert.ok(true); - } -}); + try { + this.owner.lookup('validator:inline'); + } catch (e) { + assert.ok(true); + } + }); -test('it works', function(assert) { - assert.expect(3); + test('it works', function(assert) { + assert.expect(3); - const validator = this.subject({ - options: { - foo: 'bar', - validate(value, options) { - assert.equal(this, validator, 'Context is preserved'); - assert.equal(options.foo, 'bar', 'It receives options'); - assert.notOk(options.validate, 'Validate fn removed from the options'); + const validator = this.owner.factoryFor('validator:inline').create({ + options: { + foo: 'bar', + validate(value, options) { + assert.equal(this, validator, 'Context is preserved'); + assert.equal(options.foo, 'bar', 'It receives options'); + assert.notOk( + options.validate, + 'Validate fn removed from the options' + ); + } } - } - }); + }); - validator.validate('foo', validator.get('options').toObject()); + validator.validate('foo', validator.get('options').toObject()); + }); }); diff --git a/tests/unit/validators/length-test.js b/tests/unit/validators/length-test.js index a64123ad..c02dedfc 100644 --- a/tests/unit/validators/length-test.js +++ b/tests/unit/validators/length-test.js @@ -1,122 +1,124 @@ -import { moduleFor, test } from 'ember-qunit'; +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; let options, builtOptions, validator, message; -moduleFor('validator:length', 'Unit | Validator | length', { - needs: ['validator:messages'], - setup() { - validator = this.subject(); - } -}); +module('Unit | Validator | length', function(hooks) { + setupTest(hooks); -test('no options', function(assert) { - assert.expect(1); + hooks.beforeEach(function() { + validator = this.owner.lookup('validator:length'); + }); - builtOptions = validator.buildOptions({}); + test('no options', function(assert) { + assert.expect(1); - message = validator.validate(undefined, builtOptions.toObject()); - assert.equal(message, true); -}); + builtOptions = validator.buildOptions({}); -test('allow blank', function(assert) { - assert.expect(2); + message = validator.validate(undefined, builtOptions.toObject()); + assert.equal(message, true); + }); - options = { - allowBlank: true, - min: 5 - }; + test('allow blank', function(assert) { + assert.expect(2); - builtOptions = validator.buildOptions(options); + options = { + allowBlank: true, + min: 5 + }; - message = validator.validate('', builtOptions.toObject()); - assert.equal(message, true); + builtOptions = validator.buildOptions(options); - message = validator.validate('test', builtOptions.toObject()); - assert.equal(message, 'This field is too short (minimum is 5 characters)'); -}); + message = validator.validate('', builtOptions.toObject()); + assert.equal(message, true); -test('allow none', function(assert) { - assert.expect(2); + message = validator.validate('test', builtOptions.toObject()); + assert.equal(message, 'This field is too short (minimum is 5 characters)'); + }); - options = { - // default allowNone should be true - }; + test('allow none', function(assert) { + assert.expect(2); - builtOptions = validator.buildOptions(options); + options = { + // default allowNone should be true + }; - message = validator.validate(undefined, builtOptions.toObject()); - assert.equal(message, true); + builtOptions = validator.buildOptions(options); - options.allowNone = false; - builtOptions = validator.buildOptions(options); + message = validator.validate(undefined, builtOptions.toObject()); + assert.equal(message, true); - message = validator.validate(null, builtOptions.toObject()); - assert.equal(message, 'This field is invalid'); -}); + options.allowNone = false; + builtOptions = validator.buildOptions(options); -test('is', function(assert) { - assert.expect(2); + message = validator.validate(null, builtOptions.toObject()); + assert.equal(message, 'This field is invalid'); + }); - options = { - is: 4 - }; + test('is', function(assert) { + assert.expect(2); - builtOptions = validator.buildOptions(options); + options = { + is: 4 + }; - message = validator.validate('testing', builtOptions.toObject()); - assert.equal( - message, - 'This field is the wrong length (should be 4 characters)' - ); + builtOptions = validator.buildOptions(options); - message = validator.validate('test', builtOptions.toObject()); - assert.equal(message, true); -}); + message = validator.validate('testing', builtOptions.toObject()); + assert.equal( + message, + 'This field is the wrong length (should be 4 characters)' + ); -test('min', function(assert) { - assert.expect(2); + message = validator.validate('test', builtOptions.toObject()); + assert.equal(message, true); + }); - options = { - min: 5 - }; + test('min', function(assert) { + assert.expect(2); - builtOptions = validator.buildOptions(options); + options = { + min: 5 + }; - message = validator.validate('test', builtOptions.toObject()); - assert.equal(message, 'This field is too short (minimum is 5 characters)'); + builtOptions = validator.buildOptions(options); - message = validator.validate('testing', builtOptions.toObject()); - assert.equal(message, true); -}); + message = validator.validate('test', builtOptions.toObject()); + assert.equal(message, 'This field is too short (minimum is 5 characters)'); -test('max', function(assert) { - assert.expect(2); + message = validator.validate('testing', builtOptions.toObject()); + assert.equal(message, true); + }); - options = { - max: 5 - }; + test('max', function(assert) { + assert.expect(2); - builtOptions = validator.buildOptions(options); + options = { + max: 5 + }; - message = validator.validate('testing', builtOptions.toObject()); - assert.equal(message, 'This field is too long (maximum is 5 characters)'); + builtOptions = validator.buildOptions(options); - message = validator.validate('test', builtOptions.toObject()); - assert.equal(message, true); -}); + message = validator.validate('testing', builtOptions.toObject()); + assert.equal(message, 'This field is too long (maximum is 5 characters)'); + + message = validator.validate('test', builtOptions.toObject()); + assert.equal(message, true); + }); -test('array', function(assert) { - assert.expect(2); + test('array', function(assert) { + assert.expect(2); - options = { - min: 1 - }; + options = { + min: 1 + }; - builtOptions = validator.buildOptions(options); + builtOptions = validator.buildOptions(options); - message = validator.validate([], builtOptions.toObject()); - assert.equal(message, 'This field is too short (minimum is 1 characters)'); + message = validator.validate([], builtOptions.toObject()); + assert.equal(message, 'This field is too short (minimum is 1 characters)'); - message = validator.validate([1], builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate([1], builtOptions.toObject()); + assert.equal(message, true); + }); }); diff --git a/tests/unit/validators/messages-test.js b/tests/unit/validators/messages-test.js index 4b91ab29..ba57e591 100644 --- a/tests/unit/validators/messages-test.js +++ b/tests/unit/validators/messages-test.js @@ -1,54 +1,60 @@ -import { moduleFor, test } from 'ember-qunit'; +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; let messages; -moduleFor('validator:messages', 'Unit | Validator | messages', { - setup() { - messages = this.subject(); - } -}); +module('Unit | Validator | messages', function(hooks) { + setupTest(hooks); -test('message strings present', function(assert) { - assert.expect(2); - assert.equal(messages.get('invalid'), '{description} is invalid'); - assert.equal( - messages.get('tooShort'), - '{description} is too short (minimum is {min} characters)' - ); -}); + hooks.beforeEach(function() { + messages = this.owner.lookup('validator:messages'); + }); -test('formatMessage', function(assert) { - assert.expect(3); - let context = { - description: 'This field' - }; - assert.equal( - messages.formatMessage(undefined, context), - 'This field is invalid' - ); - assert.equal( - messages.formatMessage('{foo} is undefined'), - 'undefined is undefined' - ); - assert.equal( - messages.formatMessage('{foo} {foo} {bar} {baz}', { - foo: 'a', - bar: 1, - baz: 'abc' - }), - 'a a 1 abc' - ); -}); + test('message strings present', function(assert) { + assert.expect(2); + assert.equal(messages.get('invalid'), '{description} is invalid'); + assert.equal( + messages.get('tooShort'), + '{description} is too short (minimum is {min} characters)' + ); + }); + + test('formatMessage', function(assert) { + assert.expect(3); + let context = { + description: 'This field' + }; + assert.equal( + messages.formatMessage(undefined, context), + 'This field is invalid' + ); + assert.equal( + messages.formatMessage('{foo} is undefined'), + 'undefined is undefined' + ); + assert.equal( + messages.formatMessage('{foo} {foo} {bar} {baz}', { + foo: 'a', + bar: 1, + baz: 'abc' + }), + 'a a 1 abc' + ); + }); -test('getMessageFor', function(assert) { - assert.expect(2); - let context = { - description: 'This field', - min: 4 - }; - assert.equal(messages.getMessageFor('foo', context), 'This field is invalid'); - assert.equal( - messages.getMessageFor('tooShort', context), - 'This field is too short (minimum is 4 characters)' - ); + test('getMessageFor', function(assert) { + assert.expect(2); + let context = { + description: 'This field', + min: 4 + }; + assert.equal( + messages.getMessageFor('foo', context), + 'This field is invalid' + ); + assert.equal( + messages.getMessageFor('tooShort', context), + 'This field is too short (minimum is 4 characters)' + ); + }); }); diff --git a/tests/unit/validators/number-test.js b/tests/unit/validators/number-test.js index b33ec41a..2465da63 100644 --- a/tests/unit/validators/number-test.js +++ b/tests/unit/validators/number-test.js @@ -1,241 +1,243 @@ -import { moduleFor, test } from 'ember-qunit'; +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; let options, builtOptions, validator, message; -moduleFor('validator:number', 'Unit | Validator | number', { - needs: ['validator:messages'], - setup() { - validator = this.subject(); - } -}); +module('Unit | Validator | number', function(hooks) { + setupTest(hooks); -test('no options', function(assert) { - assert.expect(2); + hooks.beforeEach(function() { + validator = this.owner.lookup('validator:number'); + }); - builtOptions = validator.buildOptions({}); + test('no options', function(assert) { + assert.expect(2); - message = validator.validate(undefined, builtOptions.toObject()); - assert.equal(message, 'This field must be a number'); + builtOptions = validator.buildOptions({}); - message = validator.validate(22, builtOptions.toObject()); - assert.equal(message, true); -}); + message = validator.validate(undefined, builtOptions.toObject()); + assert.equal(message, 'This field must be a number'); -test('allow string', function(assert) { - assert.expect(6); + message = validator.validate(22, builtOptions.toObject()); + assert.equal(message, true); + }); - options = { - allowString: true - }; - builtOptions = validator.buildOptions(options); + test('allow string', function(assert) { + assert.expect(6); - message = validator.validate('22', builtOptions.toObject()); - assert.equal(message, true); + options = { + allowString: true + }; + builtOptions = validator.buildOptions(options); - message = validator.validate('22.22', builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate('22', builtOptions.toObject()); + assert.equal(message, true); - message = validator.validate('test', builtOptions.toObject()); - assert.equal(message, 'This field must be a number'); + message = validator.validate('22.22', builtOptions.toObject()); + assert.equal(message, true); - message = validator.validate('', builtOptions.toObject()); - assert.equal(message, 'This field must be a number'); + message = validator.validate('test', builtOptions.toObject()); + assert.equal(message, 'This field must be a number'); - options.allowString = false; - builtOptions = validator.buildOptions(options); + message = validator.validate('', builtOptions.toObject()); + assert.equal(message, 'This field must be a number'); - message = validator.validate('22', builtOptions.toObject()); - assert.equal(message, 'This field must be a number'); + options.allowString = false; + builtOptions = validator.buildOptions(options); - message = validator.validate('22.22', builtOptions.toObject()); - assert.equal(message, 'This field must be a number'); -}); + message = validator.validate('22', builtOptions.toObject()); + assert.equal(message, 'This field must be a number'); -test('integer', function(assert) { - assert.expect(3); + message = validator.validate('22.22', builtOptions.toObject()); + assert.equal(message, 'This field must be a number'); + }); - options = { - integer: true - }; - builtOptions = validator.buildOptions(options); + test('integer', function(assert) { + assert.expect(3); - message = validator.validate(22, builtOptions.toObject()); - assert.equal(message, true); + options = { + integer: true + }; + builtOptions = validator.buildOptions(options); - message = validator.validate(22.22, builtOptions.toObject()); - assert.equal(message, 'This field must be an integer'); + message = validator.validate(22, builtOptions.toObject()); + assert.equal(message, true); - message = validator.validate(-2.2, builtOptions.toObject()); - assert.equal(message, 'This field must be an integer'); -}); + message = validator.validate(22.22, builtOptions.toObject()); + assert.equal(message, 'This field must be an integer'); -test('is', function(assert) { - assert.expect(2); + message = validator.validate(-2.2, builtOptions.toObject()); + assert.equal(message, 'This field must be an integer'); + }); - options = { - is: 22 - }; - builtOptions = validator.buildOptions(options); + test('is', function(assert) { + assert.expect(2); - message = validator.validate(1, builtOptions.toObject()); - assert.equal(message, 'This field must be equal to 22'); + options = { + is: 22 + }; + builtOptions = validator.buildOptions(options); - message = validator.validate(22, builtOptions.toObject()); - assert.equal(message, true); -}); + message = validator.validate(1, builtOptions.toObject()); + assert.equal(message, 'This field must be equal to 22'); -test('lt', function(assert) { - assert.expect(3); + message = validator.validate(22, builtOptions.toObject()); + assert.equal(message, true); + }); - options = { - lt: 22 - }; - builtOptions = validator.buildOptions(options); + test('lt', function(assert) { + assert.expect(3); - message = validator.validate(21, builtOptions.toObject()); - assert.equal(message, true); + options = { + lt: 22 + }; + builtOptions = validator.buildOptions(options); - message = validator.validate(22, builtOptions.toObject()); - assert.equal(message, 'This field must be less than 22'); + message = validator.validate(21, builtOptions.toObject()); + assert.equal(message, true); - message = validator.validate(23, builtOptions.toObject()); - assert.equal(message, 'This field must be less than 22'); -}); + message = validator.validate(22, builtOptions.toObject()); + assert.equal(message, 'This field must be less than 22'); -test('lte', function(assert) { - assert.expect(3); + message = validator.validate(23, builtOptions.toObject()); + assert.equal(message, 'This field must be less than 22'); + }); - options = { - lte: 22 - }; - builtOptions = validator.buildOptions(options); + test('lte', function(assert) { + assert.expect(3); - message = validator.validate(21, builtOptions.toObject()); - assert.equal(message, true); + options = { + lte: 22 + }; + builtOptions = validator.buildOptions(options); - message = validator.validate(22, builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate(21, builtOptions.toObject()); + assert.equal(message, true); - message = validator.validate(23, builtOptions.toObject()); - assert.equal(message, 'This field must be less than or equal to 22'); -}); + message = validator.validate(22, builtOptions.toObject()); + assert.equal(message, true); -test('gt', function(assert) { - assert.expect(3); + message = validator.validate(23, builtOptions.toObject()); + assert.equal(message, 'This field must be less than or equal to 22'); + }); - options = { - gt: 22 - }; - builtOptions = validator.buildOptions(options); + test('gt', function(assert) { + assert.expect(3); - message = validator.validate(21, builtOptions.toObject()); - assert.equal(message, 'This field must be greater than 22'); + options = { + gt: 22 + }; + builtOptions = validator.buildOptions(options); - message = validator.validate(22, builtOptions.toObject()); - assert.equal(message, 'This field must be greater than 22'); + message = validator.validate(21, builtOptions.toObject()); + assert.equal(message, 'This field must be greater than 22'); - message = validator.validate(23, builtOptions.toObject()); - assert.equal(message, true); -}); + message = validator.validate(22, builtOptions.toObject()); + assert.equal(message, 'This field must be greater than 22'); -test('gte', function(assert) { - assert.expect(3); + message = validator.validate(23, builtOptions.toObject()); + assert.equal(message, true); + }); - options = { - gte: 22 - }; - builtOptions = validator.buildOptions(options); + test('gte', function(assert) { + assert.expect(3); - message = validator.validate(21, builtOptions.toObject()); - assert.equal(message, 'This field must be greater than or equal to 22'); + options = { + gte: 22 + }; + builtOptions = validator.buildOptions(options); - message = validator.validate(22, builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate(21, builtOptions.toObject()); + assert.equal(message, 'This field must be greater than or equal to 22'); - message = validator.validate(23, builtOptions.toObject()); - assert.equal(message, true); -}); + message = validator.validate(22, builtOptions.toObject()); + assert.equal(message, true); -test('positive', function(assert) { - assert.expect(4); + message = validator.validate(23, builtOptions.toObject()); + assert.equal(message, true); + }); - options = { - positive: true - }; - builtOptions = validator.buildOptions(options); + test('positive', function(assert) { + assert.expect(4); - message = validator.validate(-1, builtOptions.toObject()); - assert.equal(message, 'This field must be positive'); + options = { + positive: true + }; + builtOptions = validator.buildOptions(options); - message = validator.validate(-144, builtOptions.toObject()); - assert.equal(message, 'This field must be positive'); + message = validator.validate(-1, builtOptions.toObject()); + assert.equal(message, 'This field must be positive'); - message = validator.validate(0, builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate(-144, builtOptions.toObject()); + assert.equal(message, 'This field must be positive'); - message = validator.validate(22, builtOptions.toObject()); - assert.equal(message, true); -}); + message = validator.validate(0, builtOptions.toObject()); + assert.equal(message, true); -test('odd', function(assert) { - assert.expect(4); + message = validator.validate(22, builtOptions.toObject()); + assert.equal(message, true); + }); - options = { - odd: true - }; - builtOptions = validator.buildOptions(options); + test('odd', function(assert) { + assert.expect(4); - message = validator.validate(22, builtOptions.toObject()); - assert.equal(message, 'This field must be odd'); + options = { + odd: true + }; + builtOptions = validator.buildOptions(options); - message = validator.validate(-144, builtOptions.toObject()); - assert.equal(message, 'This field must be odd'); + message = validator.validate(22, builtOptions.toObject()); + assert.equal(message, 'This field must be odd'); - message = validator.validate(21, builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate(-144, builtOptions.toObject()); + assert.equal(message, 'This field must be odd'); - message = validator.validate(-21, builtOptions.toObject()); - assert.equal(message, true); -}); + message = validator.validate(21, builtOptions.toObject()); + assert.equal(message, true); -test('even', function(assert) { - assert.expect(5); + message = validator.validate(-21, builtOptions.toObject()); + assert.equal(message, true); + }); - options = { - even: true - }; - builtOptions = validator.buildOptions(options); + test('even', function(assert) { + assert.expect(5); - message = validator.validate(22, builtOptions.toObject()); - assert.equal(message, true); + options = { + even: true + }; + builtOptions = validator.buildOptions(options); - message = validator.validate(-22, builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate(22, builtOptions.toObject()); + assert.equal(message, true); - message = validator.validate(22.22, builtOptions.toObject()); - assert.equal(message, 'This field must be even'); + message = validator.validate(-22, builtOptions.toObject()); + assert.equal(message, true); - message = validator.validate(21, builtOptions.toObject()); - assert.equal(message, 'This field must be even'); + message = validator.validate(22.22, builtOptions.toObject()); + assert.equal(message, 'This field must be even'); - message = validator.validate(-33, builtOptions.toObject()); - assert.equal(message, 'This field must be even'); -}); + message = validator.validate(21, builtOptions.toObject()); + assert.equal(message, 'This field must be even'); + + message = validator.validate(-33, builtOptions.toObject()); + assert.equal(message, 'This field must be even'); + }); -test('allowBlank', function(assert) { - assert.expect(3); + test('allowBlank', function(assert) { + assert.expect(3); - options = { - allowBlank: true - }; - builtOptions = validator.buildOptions(options); + options = { + allowBlank: true + }; + builtOptions = validator.buildOptions(options); - message = validator.validate(null, builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate(null, builtOptions.toObject()); + assert.equal(message, true); - message = validator.validate(undefined, builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate(undefined, builtOptions.toObject()); + assert.equal(message, true); - message = validator.validate('', builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate('', builtOptions.toObject()); + assert.equal(message, true); + }); }); diff --git a/tests/unit/validators/presence-test.js b/tests/unit/validators/presence-test.js index 31e7b546..806bf1e4 100644 --- a/tests/unit/validators/presence-test.js +++ b/tests/unit/validators/presence-test.js @@ -1,85 +1,87 @@ -import { moduleFor, test } from 'ember-qunit'; +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; let options, builtOptions, validator, message; -moduleFor('validator:presence', 'Unit | Validator | presence', { - needs: ['validator:messages'], - setup() { - validator = this.subject(); - } -}); +module('Unit | Validator | presence', function(hooks) { + setupTest(hooks); -test('buildOptions', function(assert) { - assert.expect(2); + hooks.beforeEach(function() { + validator = this.owner.lookup('validator:presence'); + }); - options = true; - builtOptions = validator.buildOptions(options, {}); - assert.equal(builtOptions.get('presence'), true); + test('buildOptions', function(assert) { + assert.expect(2); - options = { presence: true }; - builtOptions = validator.buildOptions(options, {}); - assert.equal(builtOptions.get('presence'), true); -}); + options = true; + builtOptions = validator.buildOptions(options, {}); + assert.equal(builtOptions.get('presence'), true); -test('presence - value present', function(assert) { - assert.expect(1); + options = { presence: true }; + builtOptions = validator.buildOptions(options, {}); + assert.equal(builtOptions.get('presence'), true); + }); - options = { presence: true }; + test('presence - value present', function(assert) { + assert.expect(1); - builtOptions = validator.buildOptions(options); + options = { presence: true }; - message = validator.validate('value', builtOptions.toObject()); - assert.equal(message, true); -}); + builtOptions = validator.buildOptions(options); -test('presence - value blank', function(assert) { - assert.expect(1); + message = validator.validate('value', builtOptions.toObject()); + assert.equal(message, true); + }); - options = { presence: true }; + test('presence - value blank', function(assert) { + assert.expect(1); - builtOptions = validator.buildOptions(options); + options = { presence: true }; - message = validator.validate(' ', builtOptions.toObject()); - assert.equal(message, true); -}); + builtOptions = validator.buildOptions(options); -test('presence with ignoreBlank - value blank', function(assert) { - assert.expect(1); + message = validator.validate(' ', builtOptions.toObject()); + assert.equal(message, true); + }); - options = { presence: true, ignoreBlank: true }; + test('presence with ignoreBlank - value blank', function(assert) { + assert.expect(1); - builtOptions = validator.buildOptions(options); + options = { presence: true, ignoreBlank: true }; - message = validator.validate(' ', builtOptions.toObject()); - assert.equal(message, "This field can't be blank"); -}); + builtOptions = validator.buildOptions(options); -test('presence - value not present', function(assert) { - assert.expect(1); + message = validator.validate(' ', builtOptions.toObject()); + assert.equal(message, "This field can't be blank"); + }); - options = { presence: true }; - builtOptions = validator.buildOptions(options); + test('presence - value not present', function(assert) { + assert.expect(1); - message = validator.validate(undefined, builtOptions.toObject()); - assert.equal(message, "This field can't be blank"); -}); + options = { presence: true }; + builtOptions = validator.buildOptions(options); -test('absence - value present', function(assert) { - assert.expect(1); + message = validator.validate(undefined, builtOptions.toObject()); + assert.equal(message, "This field can't be blank"); + }); - options = { presence: false }; - builtOptions = validator.buildOptions(options); + test('absence - value present', function(assert) { + assert.expect(1); - message = validator.validate('value', builtOptions.toObject()); - assert.equal(message, 'This field must be blank'); -}); + options = { presence: false }; + builtOptions = validator.buildOptions(options); + + message = validator.validate('value', builtOptions.toObject()); + assert.equal(message, 'This field must be blank'); + }); -test('absence - value not present', function(assert) { - assert.expect(1); + test('absence - value not present', function(assert) { + assert.expect(1); - options = { presence: false }; - builtOptions = validator.buildOptions(options); + options = { presence: false }; + builtOptions = validator.buildOptions(options); - message = validator.validate(undefined, builtOptions.toObject()); - assert.equal(message, true); + message = validator.validate(undefined, builtOptions.toObject()); + assert.equal(message, true); + }); }); diff --git a/yarn.lock b/yarn.lock index 31e5d5c3..1bdd887a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,111 @@ # yarn lockfile v1 +"@babel/code-frame@7.0.0-beta.42", "@babel/code-frame@^7.0.0-beta.40": + version "7.0.0-beta.42" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.42.tgz#a9c83233fa7cd06b39dc77adbb908616ff4f1962" + dependencies: + "@babel/highlight" "7.0.0-beta.42" + +"@babel/generator@7.0.0-beta.42": + version "7.0.0-beta.42" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.42.tgz#777bb50f39c94a7e57f73202d833141f8159af33" + dependencies: + "@babel/types" "7.0.0-beta.42" + jsesc "^2.5.1" + lodash "^4.2.0" + source-map "^0.5.0" + trim-right "^1.0.1" + +"@babel/helper-function-name@7.0.0-beta.42": + version "7.0.0-beta.42" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.42.tgz#b38b8f4f85168d1812c543dd700b5d549b0c4658" + dependencies: + "@babel/helper-get-function-arity" "7.0.0-beta.42" + "@babel/template" "7.0.0-beta.42" + "@babel/types" "7.0.0-beta.42" + +"@babel/helper-get-function-arity@7.0.0-beta.42": + version "7.0.0-beta.42" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.42.tgz#ad072e32f912c033053fc80478169aeadc22191e" + dependencies: + "@babel/types" "7.0.0-beta.42" + +"@babel/helper-split-export-declaration@7.0.0-beta.42": + version "7.0.0-beta.42" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.42.tgz#0d0d5254220a9cc4e7e226240306b939dc210ee7" + dependencies: + "@babel/types" "7.0.0-beta.42" + +"@babel/highlight@7.0.0-beta.42": + version "7.0.0-beta.42" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.42.tgz#a502a1c0d6f99b2b0e81d468a1b0c0e81e3f3623" + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + +"@babel/template@7.0.0-beta.42": + version "7.0.0-beta.42" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.42.tgz#7186d4e70d44cdec975049ba0a73bdaf5cdee052" + dependencies: + "@babel/code-frame" "7.0.0-beta.42" + "@babel/types" "7.0.0-beta.42" + babylon "7.0.0-beta.42" + lodash "^4.2.0" + +"@babel/traverse@^7.0.0-beta.40": + version "7.0.0-beta.42" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.42.tgz#f4bf4d1e33d41baf45205e2d0463591d57326285" + dependencies: + "@babel/code-frame" "7.0.0-beta.42" + "@babel/generator" "7.0.0-beta.42" + "@babel/helper-function-name" "7.0.0-beta.42" + "@babel/helper-split-export-declaration" "7.0.0-beta.42" + "@babel/types" "7.0.0-beta.42" + babylon "7.0.0-beta.42" + debug "^3.1.0" + globals "^11.1.0" + invariant "^2.2.0" + lodash "^4.2.0" + +"@babel/types@7.0.0-beta.42", "@babel/types@^7.0.0-beta.40": + version "7.0.0-beta.42" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.42.tgz#1e2118767684880f6963801b272fd2b3348efacc" + dependencies: + esutils "^2.0.2" + lodash "^4.2.0" + to-fast-properties "^2.0.0" + +"@ember-decorators/argument@^0.8.10": + version "0.8.13" + resolved "https://registry.yarnpkg.com/@ember-decorators/argument/-/argument-0.8.13.tgz#217804178c4278a8c264a2878b66c0cb55b77e3d" + dependencies: + babel-plugin-filter-imports "^1.1.1" + broccoli-funnel "^2.0.1" + ember-cli-babel "^6.3.0" + ember-cli-version-checker "^2.0.0" + ember-compatibility-helpers "^1.0.0-beta.2" + ember-get-config "^0.2.3" + ember-source-channel-url "^1.0.1" + ember-try "^0.2.23" + +"@ember-decorators/babel-transforms@^0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@ember-decorators/babel-transforms/-/babel-transforms-0.1.1.tgz#c2be1677192e55ccfeb806002d57e314a0e728bc" + dependencies: + babel-plugin-transform-class-properties "^6.24.1" + babel-plugin-transform-decorators-legacy "^1.3.4" + ember-cli-babel "^6.6.0" + ember-cli-version-checker "^2.1.0" + +"@ember-decorators/utils@^0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@ember-decorators/utils/-/utils-0.2.0.tgz#395362c75c4f85aa63aa7cbed77a6486fd6e5f22" + dependencies: + ember-cli-babel "^6.6.0" + ember-compatibility-helpers "^0.1.2" + "@ember/test-helpers@^0.7.9": version "0.7.16" resolved "https://registry.yarnpkg.com/@ember/test-helpers/-/test-helpers-0.7.16.tgz#73a4acf4c7d1b92ce866f4c9e40c9723da4cf1e8" @@ -20,23 +125,9 @@ dependencies: "@glimmer/di" "^0.2.0" -Base64@~0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/Base64/-/Base64-0.2.1.tgz#ba3a4230708e186705065e66babdd4c35cf60028" - -JSONStream@~0.6.4: - version "0.6.4" - resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-0.6.4.tgz#4b2c8063f8f512787b2375f7ee9db69208fa2dcb" - dependencies: - jsonparse "0.0.5" - through "~2.2.7" - -JSONStream@~0.7.1: - version "0.7.4" - resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-0.7.4.tgz#734290e41511eea7c2cfe151fbf9a563a97b9786" - dependencies: - jsonparse "0.0.5" - through ">=2.2.7 <3" +"@sindresorhus/is@^0.7.0": + version "0.7.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd" abbrev@1: version "1.1.0" @@ -66,10 +157,6 @@ acorn-jsx@^3.0.0: dependencies: acorn "^3.0.4" -acorn@^2.7.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-2.7.0.tgz#ab6e7d9d886aaca8b085bc3312b79a198433f0e7" - acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" @@ -176,6 +263,12 @@ ansi-styles@^3.0.0, ansi-styles@^3.1.0: dependencies: color-convert "^1.9.0" +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + dependencies: + color-convert "^1.9.0" + ansi@^0.3.0, ansi@~0.3.0, ansi@~0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/ansi/-/ansi-0.3.1.tgz#0c42d4fb17160d5a9af1e484bace1c66922c1b21" @@ -310,7 +403,7 @@ arrify@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" -asap@^2.0.0, asap@~2.0.3: +asap@^2.0.0: version "2.0.6" resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" @@ -334,12 +427,6 @@ assert-plus@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" -assert@~1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/assert/-/assert-1.1.2.tgz#adaa04c46bb58c6dd1f294da3eb26e6228eb6e44" - dependencies: - util "0.10.3" - assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" @@ -348,6 +435,10 @@ ast-traverse@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ast-traverse/-/ast-traverse-0.1.1.tgz#69cf2b8386f19dcda1bb1e05d68fe359d8897de6" +ast-types@0.10.1: + version "0.10.1" + resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.10.1.tgz#f52fca9715579a14f841d67d7f8d25432ab6a3dd" + ast-types@0.10.2: version "0.10.2" resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.10.2.tgz#aef76a04fde54634976fc94defaad1a67e2eadb0" @@ -364,12 +455,6 @@ ast-types@0.9.6: version "0.9.6" resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.6.tgz#102c9e9e9005d3e7e3829bf0c4fa24ee862ee9b9" -astw@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/astw/-/astw-2.2.0.tgz#7bd41784d32493987aeb239b6b4e1c57a873b917" - dependencies: - acorn "^4.0.3" - async-disk-cache@^1.2.1: version "1.3.3" resolved "https://registry.yarnpkg.com/async-disk-cache/-/async-disk-cache-1.3.3.tgz#6040486660b370e4051cd9fa9fee275e1fae3728" @@ -386,6 +471,10 @@ async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" +async-foreach@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/async-foreach/-/async-foreach-0.1.3.tgz#36121f845c0578172de419a97dbeb1d16ec34542" + async-promise-queue@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/async-promise-queue/-/async-promise-queue-1.0.4.tgz#308baafbc74aff66a0bb6e7f4a18d4fe8434440c" @@ -399,7 +488,7 @@ async-some@~1.0.2: dependencies: dezalgo "^1.0.2" -async@0.2.x, async@~0.2.6, async@~0.2.9: +async@0.2.x, async@~0.2.9: version "0.2.10" resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1" @@ -537,6 +626,17 @@ babel-core@^6.10.4, babel-core@^6.14.0, babel-core@^6.24.1, babel-core@^6.26.0: slash "^1.0.0" source-map "^0.5.6" +babel-eslint@^8.0.3: + version "8.2.2" + resolved "http://registry.npmjs.org/babel-eslint/-/babel-eslint-8.2.2.tgz#1102273354c6f0b29b4ea28a65f97d122296b68b" + dependencies: + "@babel/code-frame" "^7.0.0-beta.40" + "@babel/traverse" "^7.0.0-beta.40" + "@babel/types" "^7.0.0-beta.40" + babylon "^7.0.0-beta.40" + eslint-scope "~3.7.1" + eslint-visitor-keys "^1.0.0" + babel-generator@^6.26.0: version "6.26.1" resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" @@ -707,6 +807,13 @@ babel-plugin-filter-imports@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/babel-plugin-filter-imports/-/babel-plugin-filter-imports-0.3.1.tgz#e7859b56886b175dd2616425d277b219e209ea8b" +babel-plugin-filter-imports@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/babel-plugin-filter-imports/-/babel-plugin-filter-imports-1.1.1.tgz#0f418fb517a7c64b54461b947940081e51b3fd9d" + dependencies: + babel-types "^6.26.0" + lodash "^4.17.4" + babel-plugin-htmlbars-inline-precompile@^0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/babel-plugin-htmlbars-inline-precompile/-/babel-plugin-htmlbars-inline-precompile-0.2.3.tgz#cd365e278af409bfa6be7704c4354beee742446b" @@ -757,6 +864,14 @@ babel-plugin-syntax-async-functions@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" +babel-plugin-syntax-class-properties@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz#d7eb23b79a317f8543962c505b827c7d6cac27de" + +babel-plugin-syntax-decorators@^6.1.18: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz#312563b4dbde3cc806cee3e416cceeaddd11ac0b" + babel-plugin-syntax-exponentiation-operator@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" @@ -773,6 +888,23 @@ babel-plugin-transform-async-to-generator@^6.22.0, babel-plugin-transform-async- babel-plugin-syntax-async-functions "^6.8.0" babel-runtime "^6.22.0" +babel-plugin-transform-class-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz#6a79763ea61d33d36f37b611aa9def81a81b46ac" + dependencies: + babel-helper-function-name "^6.24.1" + babel-plugin-syntax-class-properties "^6.8.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-decorators-legacy@^1.3.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-decorators-legacy/-/babel-plugin-transform-decorators-legacy-1.3.4.tgz#741b58f6c5bce9e6027e0882d9c994f04f366925" + dependencies: + babel-plugin-syntax-decorators "^6.1.18" + babel-runtime "^6.2.0" + babel-template "^6.3.0" + babel-plugin-transform-es2015-arrow-functions@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" @@ -1027,14 +1159,14 @@ babel-register@^6.26.0: mkdirp "^0.5.1" source-map-support "^0.4.15" -babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: +babel-runtime@^6.18.0, babel-runtime@^6.2.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" dependencies: core-js "^2.4.0" regenerator-runtime "^0.11.0" -babel-template@^6.24.1, babel-template@^6.26.0: +babel-template@^6.24.1, babel-template@^6.26.0, babel-template@^6.3.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" dependencies: @@ -1075,6 +1207,10 @@ babel6-plugin-strip-heimdall@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/babel6-plugin-strip-heimdall/-/babel6-plugin-strip-heimdall-6.0.1.tgz#35f80eddec1f7fffdc009811dfbd46d9965072b6" +babylon@7.0.0-beta.42, babylon@^7.0.0-beta.40: + version "7.0.0-beta.42" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.42.tgz#67cfabcd4f3ec82999d29031ccdea89d0ba99657" + babylon@^5.8.38: version "5.8.38" resolved "https://registry.yarnpkg.com/babylon/-/babylon-5.8.38.tgz#ec9b120b11bf6ccd4173a18bf217e60b79859ffd" @@ -1101,10 +1237,6 @@ base64-arraybuffer@0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8" -base64-js@~0.0.4: - version "0.0.8" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-0.0.8.tgz#1101e9544f4a76b1bc3b26d452ca96d7a35e7978" - base64id@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/base64id/-/base64id-0.1.0.tgz#02ce0fdeee0cef4f40080e1e73e834f0b1bfce3f" @@ -1224,6 +1356,10 @@ boom@2.x.x: dependencies: hoek "2.x.x" +bootstrap-sass@^3.3.7: + version "3.3.7" + resolved "https://registry.yarnpkg.com/bootstrap-sass/-/bootstrap-sass-3.3.7.tgz#6596c7ab40f6637393323ab0bc80d064fc630498" + bower-config@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/bower-config/-/bower-config-1.4.0.tgz#16c38c1135f8071c19f25938d61b0d8cbf18d3f1" @@ -1350,21 +1486,6 @@ broccoli-babel-transpiler@^6.1.2: rsvp "^3.5.0" workerpool "^2.2.1" -broccoli-brocfile-loader@^0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/broccoli-brocfile-loader/-/broccoli-brocfile-loader-0.18.0.tgz#2e86021c805c34ffc8d29a2fb721cf273e819e4b" - dependencies: - findup-sync "^0.4.2" - -broccoli-browserify@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/broccoli-browserify/-/broccoli-browserify-0.1.0.tgz#09d7f0e0b3a2e2fd7560ac376865dc68cc175026" - dependencies: - broccoli-writer "^0.1.1" - browserify "^3.31.2" - mkdirp "^0.3.5" - rsvp "^3.0.6" - broccoli-builder@^0.18.8: version "0.18.8" resolved "https://registry.yarnpkg.com/broccoli-builder/-/broccoli-builder-0.18.8.tgz#fe54694d544c3cdfdb01028e802eeca65749a879" @@ -1376,7 +1497,7 @@ broccoli-builder@^0.18.8: rsvp "^3.0.17" silent-error "^1.0.1" -broccoli-caching-writer@^2.2.0, broccoli-caching-writer@^2.3.1: +broccoli-caching-writer@^2.2.0: version "2.3.1" resolved "https://registry.yarnpkg.com/broccoli-caching-writer/-/broccoli-caching-writer-2.3.1.tgz#b93cf58f9264f003075868db05774f4e7f25bd07" dependencies: @@ -1500,9 +1621,9 @@ broccoli-filter@^1.2.2, broccoli-filter@^1.2.3: symlink-or-copy "^1.0.1" walk-sync "^0.3.1" -broccoli-flatiron@^0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/broccoli-flatiron/-/broccoli-flatiron-0.0.0.tgz#e97504016b56eea04813b5d862fda18b6f11a77f" +broccoli-flatiron@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/broccoli-flatiron/-/broccoli-flatiron-0.1.2.tgz#088cf6f03cee71721a925df9bb12cabf07e6b65c" dependencies: broccoli-kitchen-sink-helpers "~0.2.4" broccoli-writer "~0.1.1" @@ -1564,16 +1685,6 @@ broccoli-kitchen-sink-helpers@^0.3.1: glob "^5.0.10" mkdirp "^0.5.1" -broccoli-less-single@^0.6.4: - version "0.6.4" - resolved "https://registry.yarnpkg.com/broccoli-less-single/-/broccoli-less-single-0.6.4.tgz#200316f4146b8cf7e6ab97fc661b8085cc89bdb9" - dependencies: - broccoli-caching-writer "^2.3.1" - include-path-searcher "^0.1.0" - less "^2.5.0" - lodash.merge "^3.3.2" - mkdirp "^0.5.0" - broccoli-lint-eslint@^4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/broccoli-lint-eslint/-/broccoli-lint-eslint-4.2.1.tgz#f780dc083a7357a9746a9cfa8f76feb092777477" @@ -1586,7 +1697,7 @@ broccoli-lint-eslint@^4.2.1: lodash.defaultsdeep "^4.6.0" md5-hex "^2.0.0" -broccoli-merge-trees@^1.0.0, broccoli-merge-trees@^1.1.1: +broccoli-merge-trees@^1.0.0, broccoli-merge-trees@^1.1.0, broccoli-merge-trees@^1.1.1: version "1.2.4" resolved "https://registry.yarnpkg.com/broccoli-merge-trees/-/broccoli-merge-trees-1.2.4.tgz#a001519bb5067f06589d91afa2942445a2d0fdb5" dependencies: @@ -1606,12 +1717,12 @@ broccoli-merge-trees@^2.0.0: broccoli-plugin "^1.3.0" merge-trees "^1.0.1" -broccoli-middleware@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/broccoli-middleware/-/broccoli-middleware-1.0.0.tgz#92f4e1fb9a791ea986245a7077f35cc648dab097" +broccoli-middleware@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/broccoli-middleware/-/broccoli-middleware-1.2.1.tgz#a21f255f8bfe5a21c2f0fbf2417addd9d24c9436" dependencies: handlebars "^4.0.4" - mime "^1.2.11" + mime-types "^2.1.18" broccoli-persistent-filter@^1.0.3, broccoli-persistent-filter@^1.1.6, broccoli-persistent-filter@^1.4.2: version "1.4.2" @@ -1684,6 +1795,17 @@ broccoli-rollup@^1.2.0: symlink-or-copy "^1.1.8" walk-sync "^0.3.1" +broccoli-sass-source-maps@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/broccoli-sass-source-maps/-/broccoli-sass-source-maps-2.2.0.tgz#1f1a0794136152b096188638b59b42b17a4bdc68" + dependencies: + broccoli-caching-writer "^3.0.3" + include-path-searcher "^0.1.0" + mkdirp "^0.3.5" + node-sass "^4.7.2" + object-assign "^2.0.0" + rsvp "^3.0.6" + broccoli-slow-trees@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/broccoli-slow-trees/-/broccoli-slow-trees-3.0.1.tgz#9bf2a9e2f8eb3ed3a3f2abdde988da437ccdc9b4" @@ -1712,7 +1834,7 @@ broccoli-static-compiler@^0.1.4: broccoli-writer "^0.1.1" mkdirp "^0.3.5" -broccoli-stew@^1.2.0, broccoli-stew@^1.3.3, broccoli-stew@^1.4.0: +broccoli-stew@^1.2.0, broccoli-stew@^1.3.3, broccoli-stew@^1.4.0, broccoli-stew@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/broccoli-stew/-/broccoli-stew-1.5.0.tgz#d7af8c18511dce510e49d308a62e5977f461883c" dependencies: @@ -1752,78 +1874,6 @@ broccoli-writer@^0.1.1, broccoli-writer@~0.1.1: quick-temp "^0.1.0" rsvp "^3.0.6" -browser-pack@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/browser-pack/-/browser-pack-2.0.1.tgz#5d1c527f56c582677411c4db2a128648ff6bf150" - dependencies: - JSONStream "~0.6.4" - combine-source-map "~0.3.0" - through "~2.3.4" - -browser-resolve@~1.2.1, browser-resolve@~1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.2.4.tgz#59ae7820a82955ecd32f5fb7c468ac21c4723806" - dependencies: - resolve "0.6.3" - -browserify-zlib@~0.1.2: - version "0.1.4" - resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.1.4.tgz#bb35f8a519f600e0fa6b8485241c979d0141fb2d" - dependencies: - pako "~0.2.0" - -browserify@^3.31.2: - version "3.46.1" - resolved "https://registry.yarnpkg.com/browserify/-/browserify-3.46.1.tgz#2c2e4a7f2f408178e78c223b5b57b37c2185ad8e" - dependencies: - JSONStream "~0.7.1" - assert "~1.1.0" - browser-pack "~2.0.0" - browser-resolve "~1.2.1" - browserify-zlib "~0.1.2" - buffer "~2.1.4" - builtins "~0.0.3" - commondir "0.0.1" - concat-stream "~1.4.1" - console-browserify "~1.0.1" - constants-browserify "~0.0.1" - crypto-browserify "~1.0.9" - deep-equal "~0.1.0" - defined "~0.0.0" - deps-sort "~0.1.1" - derequire "~0.8.0" - domain-browser "~1.1.0" - duplexer "~0.1.1" - events "~1.0.0" - glob "~3.2.8" - http-browserify "~1.3.1" - https-browserify "~0.0.0" - inherits "~2.0.1" - insert-module-globals "~6.0.0" - module-deps "~2.0.0" - os-browserify "~0.1.1" - parents "~0.0.1" - path-browserify "~0.0.0" - process "^0.7.0" - punycode "~1.2.3" - querystring-es3 "0.2.0" - resolve "~0.6.1" - shallow-copy "0.0.1" - shell-quote "~0.0.1" - stream-browserify "~0.1.0" - stream-combiner "~0.0.2" - string_decoder "~0.0.0" - subarg "0.0.1" - syntax-error "~1.1.0" - through2 "~0.4.1" - timers-browserify "~1.0.1" - tty-browserify "~0.0.0" - umd "~2.0.0" - url "~0.10.1" - util "~0.10.1" - vm-browserify "~0.0.1" - xtend "^3.0.0" - browserslist@^1.7.6: version "1.7.7" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-1.7.7.tgz#0bd76704258be829b2398bb50e4b62d1a166b0b9" @@ -1831,31 +1881,31 @@ browserslist@^1.7.6: caniuse-db "^1.0.30000639" electron-to-chromium "^1.2.7" -browserslist@^2.1.2: +browserslist@^2.1.2, browserslist@^2.2.2: version "2.11.3" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-2.11.3.tgz#fe36167aed1bbcde4827ebfe71347a2cc70b99b2" dependencies: caniuse-lite "^1.0.30000792" electron-to-chromium "^1.3.30" +browserslist@^3.1.0: + version "3.2.4" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-3.2.4.tgz#fb9ad70fd09875137ae943a31ab815ed76896031" + dependencies: + caniuse-lite "^1.0.30000821" + electron-to-chromium "^1.3.41" + bser@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" dependencies: node-int64 "^0.4.0" -buffer@~2.1.4: - version "2.1.13" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-2.1.13.tgz#c88838ebf79f30b8b4a707788470bea8a62c2355" - dependencies: - base64-js "~0.0.4" - ieee754 "~1.1.1" - builtin-modules@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" -builtins@0.0.7, builtins@~0.0.3: +builtins@0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/builtins/-/builtins-0.0.7.tgz#355219cd6cf18dbe7c01cc7fd2dce765cfdc549a" @@ -1893,6 +1943,18 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" +cacheable-request@^2.1.1: + version "2.1.4" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-2.1.4.tgz#0d808801b6342ad33c91df9d0b44dc09b91e5c3d" + dependencies: + clone-response "1.0.2" + get-stream "3.0.0" + http-cache-semantics "3.8.1" + keyv "3.0.0" + lowercase-keys "1.0.0" + normalize-url "2.0.1" + responselike "1.0.2" + calculate-cache-key-for-tree@^1.0.0, calculate-cache-key-for-tree@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/calculate-cache-key-for-tree/-/calculate-cache-key-for-tree-1.1.0.tgz#0c3e42c9c134f3c9de5358c0f16793627ea976d6" @@ -1905,7 +1967,7 @@ caller-path@^0.1.0: dependencies: callsites "^0.2.0" -callsite@1.0.0, callsite@~1.0.0: +callsite@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20" @@ -1928,6 +1990,10 @@ camelcase@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" +camelcase@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" + can-symlink@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/can-symlink/-/can-symlink-1.0.0.tgz#97b607d8a84bb6c6e228b902d864ecb594b9d219" @@ -1942,6 +2008,10 @@ caniuse-lite@^1.0.30000792: version "1.0.30000805" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000805.tgz#83a5f21ead01486e67bccca6fae5dca7cde496de" +caniuse-lite@^1.0.30000821: + version "1.0.30000821" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000821.tgz#0f3223f1e048ed96451c56ca6cf197058c42cb93" + capture-exit@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-1.2.0.tgz#1c5fcc489fd0ab00d4f1ac7ae1072e3173fbab6f" @@ -1990,7 +2060,7 @@ chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0: +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0: version "2.3.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.0.tgz#b5ea48efc9c1793dccc9b4767c93914d3f2d52ba" dependencies: @@ -1998,6 +2068,14 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0: escape-string-regexp "^1.0.5" supports-color "^4.0.0" +chalk@^2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.2.tgz#250dc96b07491bfd601e648d66ddf5f60c7a5c65" + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + chardet@^0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" @@ -2071,7 +2149,7 @@ cli-cursor@^2.1.0: dependencies: restore-cursor "^2.0.0" -cli-spinners@^1.0.1: +cli-spinners@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-1.1.0.tgz#f1847b168844d917a671eb9d147e3df497c90d06" @@ -2106,6 +2184,20 @@ cliui@^2.1.0: right-align "^0.1.1" wordwrap "0.0.2" +cliui@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + +clone-response@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" + dependencies: + mimic-response "^1.0.0" + clone@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/clone/-/clone-0.2.0.tgz#c6126a90ad4f72dbf5acdb243cc37724fe93fc1f" @@ -2169,14 +2261,6 @@ columnify@~1.5.4: strip-ansi "^3.0.0" wcwidth "^1.0.0" -combine-source-map@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.3.0.tgz#d9e74f593d9cd43807312cb5d846d451efaa9eb7" - dependencies: - convert-source-map "~0.3.0" - inline-source-map "~0.3.0" - source-map "~0.1.31" - combined-stream@^1.0.5, combined-stream@~1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" @@ -2213,10 +2297,6 @@ common-tags@^1.4.0: dependencies: babel-runtime "^6.26.0" -commondir@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/commondir/-/commondir-0.0.1.tgz#89f00fdcd51b519c578733fec563e6a6da7f5be2" - commoner@~0.10.3: version "0.10.8" resolved "https://registry.yarnpkg.com/commoner/-/commoner-0.10.8.tgz#34fc3672cd24393e8bb47e70caa0293811f4f2c5" @@ -2277,14 +2357,6 @@ concat-stream@^1.4.6, concat-stream@^1.4.7, concat-stream@^1.6.0: readable-stream "^2.2.2" typedarray "^0.0.6" -concat-stream@~1.4.1, concat-stream@~1.4.5: - version "1.4.10" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.4.10.tgz#acc3bbf5602cb8cc980c6ac840fa7d8603e3ef36" - dependencies: - inherits "~2.0.1" - readable-stream "~1.1.9" - typedarray "~0.0.5" - config-chain@~1.1.9: version "1.1.11" resolved "https://registry.yarnpkg.com/config-chain/-/config-chain-1.1.11.tgz#aba09747dfbe4c3e70e766a6e41586e1859fc6f2" @@ -2303,22 +2375,18 @@ configstore@^3.0.0: write-file-atomic "^2.0.0" xdg-basedir "^3.0.0" -console-browserify@~1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.0.3.tgz#d3898d2c3a93102f364197f8874b4f92b5286a8e" - console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" -console-ui@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/console-ui/-/console-ui-2.1.0.tgz#e1d5279d27621a75123d7d594f9fa59f866ea3e3" +console-ui@^2.1.0: + version "2.2.2" + resolved "https://registry.yarnpkg.com/console-ui/-/console-ui-2.2.2.tgz#b294a2934de869dd06789ab4be69555411edef29" dependencies: chalk "^2.1.0" inquirer "^2" json-stable-stringify "^1.0.1" - ora "^1.3.0" + ora "^2.0.0" through "^2.3.8" user-info "^1.0.0" @@ -2328,10 +2396,6 @@ consolidate@^0.14.0: dependencies: bluebird "^3.1.1" -constants-browserify@~0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-0.0.1.tgz#92577db527ba6c4cf0a4568d84bc031f441e21f2" - content-disposition@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4" @@ -2344,14 +2408,10 @@ continuable-cache@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/continuable-cache/-/continuable-cache-0.3.1.tgz#bd727a7faed77e71ff3985ac93351a912733ad0f" -convert-source-map@^1.1.0, convert-source-map@^1.5.0: +convert-source-map@^1.1.0, convert-source-map@^1.5.0, convert-source-map@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" -convert-source-map@~0.3.0: - version "0.3.5" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-0.3.5.tgz#f1d802950af7dd2631a1febe0596550c86ab3190" - cookie-signature@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" @@ -2376,6 +2436,10 @@ core-js@^2.4.0, core-js@^2.5.0: version "2.5.3" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.3.tgz#8acc38345824f16d8365b7c9b4259168e8ed603e" +core-js@^2.4.1: + version "2.5.4" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.4.tgz#f2c8bf181f2a80b92f360121429ce63a2f0aeae0" + core-object@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/core-object/-/core-object-1.1.0.tgz#86d63918733cf9da1a5aae729e62c0a88e66ad0a" @@ -2390,6 +2454,13 @@ core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" +cross-spawn@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-3.0.1.tgz#1256037ecb9f0c5f79e3d6ef135e30770184b982" + dependencies: + lru-cache "^4.0.1" + which "^1.2.9" + cross-spawn@^5.0.1, cross-spawn@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" @@ -2410,10 +2481,6 @@ cryptiles@2.x.x: dependencies: boom "2.x.x" -crypto-browserify@~1.0.9: - version "1.0.9" - resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-1.0.9.tgz#cc5449685dfb85eb11c9828acc7cb87ab5bbfcc0" - crypto-random-string@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" @@ -2492,7 +2559,7 @@ debuglog@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" -decamelize@^1.0.0, decamelize@^1.1.2: +decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -2500,14 +2567,16 @@ decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" +decompress-response@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" + dependencies: + mimic-response "^1.0.0" + deep-equal@*: version "1.0.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" -deep-equal@~0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-0.1.2.tgz#b246c2b80a570a47c11be1d9bd1070ec878b87ce" - deep-extend@~0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" @@ -2538,10 +2607,6 @@ defined@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" -defined@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/defined/-/defined-0.0.0.tgz#f35eea7d705e933baf13b2f03b3f83d921403b3e" - defs@~1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/defs/-/defs-1.1.1.tgz#b22609f2c7a11ba7a3db116805c139b1caffa9d2" @@ -2589,22 +2654,6 @@ depd@~1.1.0, depd@~1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" -deps-sort@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/deps-sort/-/deps-sort-0.1.2.tgz#daa2fb614a17c9637d801e2f55339ae370f3611a" - dependencies: - JSONStream "~0.6.4" - minimist "~0.0.1" - through "~2.3.4" - -derequire@~0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/derequire/-/derequire-0.8.0.tgz#c1f7f1da2cede44adede047378f03f444e9c4c0d" - dependencies: - esprima-fb "^3001.1.0-dev-harmony-fb" - esrefactor "~0.1.0" - estraverse "~1.5.0" - destroy@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" @@ -2644,13 +2693,6 @@ detective@^4.3.1: acorn "^4.0.3" defined "^1.0.0" -detective@~3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/detective/-/detective-3.1.0.tgz#77782444ab752b88ca1be2e9d0a0395f1da25eed" - dependencies: - escodegen "~1.1.0" - esprima-fb "3001.1.0-dev-harmony-fb" - dezalgo@^1.0.0, dezalgo@^1.0.1, dezalgo@^1.0.2, dezalgo@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/dezalgo/-/dezalgo-1.0.3.tgz#7f742de066fc748bc8db820569dddce49bf0d456" @@ -2668,25 +2710,15 @@ doctrine@^2.1.0: dependencies: esutils "^2.0.2" -domain-browser@~1.1.0: - version "1.1.7" - resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.1.7.tgz#867aa4b093faa05f1de08c06f4d7b21fdf8698bc" - dot-prop@^4.1.0: version "4.2.0" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.2.0.tgz#1f19e0c2e1aa0e32797c49799f2837ac6af69c57" dependencies: is-obj "^1.0.0" -duplexer2@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.0.2.tgz#c614dcf67e2fb14995a91711e5a617e8a60a31db" - dependencies: - readable-stream "~1.1.9" - -duplexer@~0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" +duplexer3@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" ecc-jsbn@~0.1.1: version "0.1.1" @@ -2714,6 +2746,42 @@ electron-to-chromium@^1.3.30: version "1.3.33" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.33.tgz#bf00703d62a7c65238136578c352d6c5c042a545" +electron-to-chromium@^1.3.41: + version "1.3.41" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.41.tgz#7e33643e00cd85edfd17e04194f6d00e73737235" + +ember-assign-polyfill@^2.0.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/ember-assign-polyfill/-/ember-assign-polyfill-2.2.0.tgz#7953836e5ccd4da05b2493423d3efc00df80ca74" + dependencies: + ember-cli-babel "^6.8.2" + ember-cli-version-checker "^2.0.0" + +ember-bootstrap@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ember-bootstrap/-/ember-bootstrap-1.2.1.tgz#9b88d7568f162b211fa78b4030abade283ad4b52" + dependencies: + broccoli-debug "^0.6.3" + broccoli-funnel "^2.0.0" + broccoli-merge-trees "^2.0.0" + broccoli-stew "^1.4.0" + chalk "^2.1.0" + ember-assign-polyfill "^2.0.1" + ember-cli-babel "^6.8.2" + ember-cli-build-config-editor "0.5.0" + ember-cli-htmlbars "^2.0.2" + ember-cli-version-checker "^2.1.0" + ember-concurrency "^0.8.7" + ember-in-element-polyfill "^0.1.2" + ember-maybe-in-element "^0.1.3" + ember-popper "^0.8.3" + ember-runtime-enumerable-includes-polyfill "^2.0.0" + findup-sync "^1.0.0" + fs-extra "^4.0.1" + resolve "^1.5.0" + rsvp "^4.0.1" + silent-error "^1.0.1" + ember-cli-app-version@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/ember-cli-app-version/-/ember-cli-app-version-2.0.2.tgz#aaeede608e92fae6c2e11f63d28a373c1cc3f070" @@ -2729,7 +2797,7 @@ ember-cli-autoprefixer@^0.7.0: broccoli-autoprefixer "^4.1.0" lodash "^4.0.0" -ember-cli-babel@^5.1.3, ember-cli-babel@^5.1.5, ember-cli-babel@^5.1.6, ember-cli-babel@^5.1.7: +ember-cli-babel@^5.1.5, ember-cli-babel@^5.1.6, ember-cli-babel@^5.1.7: version "5.2.4" resolved "https://registry.yarnpkg.com/ember-cli-babel/-/ember-cli-babel-5.2.4.tgz#5ce4f46b08ed6f6d21e878619fb689719d6e8e13" dependencies: @@ -2774,6 +2842,24 @@ ember-cli-babel@^6.0.0-beta.7, ember-cli-babel@^6.3.0: clone "^2.0.0" ember-cli-version-checker "^2.0.0" +ember-cli-babel@^6.11.0: + version "6.12.0" + resolved "https://registry.yarnpkg.com/ember-cli-babel/-/ember-cli-babel-6.12.0.tgz#3adcdbe1278da1fcd0b9038f1360cb4ac5d4414c" + dependencies: + amd-name-resolver "0.0.7" + babel-plugin-debug-macros "^0.1.11" + babel-plugin-ember-modules-api-polyfill "^2.3.0" + babel-plugin-transform-es2015-modules-amd "^6.24.0" + babel-polyfill "^6.16.0" + babel-preset-env "^1.5.1" + broccoli-babel-transpiler "^6.1.2" + broccoli-debug "^0.6.2" + broccoli-funnel "^1.0.0" + broccoli-source "^1.1.0" + clone "^2.0.0" + ember-cli-version-checker "^2.1.0" + semver "^5.4.1" + ember-cli-babel@^6.9.2: version "6.10.0" resolved "https://registry.yarnpkg.com/ember-cli-babel/-/ember-cli-babel-6.10.0.tgz#81424acd1d97fb13658168121eeb2007d6edee84" @@ -2802,6 +2888,12 @@ ember-cli-broccoli-sane-watcher@^2.0.4: rsvp "^3.0.18" sane "^1.1.1" +ember-cli-build-config-editor@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/ember-cli-build-config-editor/-/ember-cli-build-config-editor-0.5.0.tgz#e19a06f4da2e3e579b407964b72df9fbf3839f4b" + dependencies: + recast "^0.12.0" + ember-cli-changelog@0.3.4: version "0.3.4" resolved "https://registry.yarnpkg.com/ember-cli-changelog/-/ember-cli-changelog-0.3.4.tgz#6bdb711ade38ea9128217a27ca68c94a4d1fadcb" @@ -2861,17 +2953,12 @@ ember-cli-get-component-path-option@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/ember-cli-get-component-path-option/-/ember-cli-get-component-path-option-1.0.0.tgz#0d7b595559e2f9050abed804f1d8eff1b08bc771" -ember-cli-get-dependency-depth@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/ember-cli-get-dependency-depth/-/ember-cli-get-dependency-depth-1.0.0.tgz#e0afecf82a2d52f00f28ab468295281aec368d11" - -ember-cli-github-pages@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ember-cli-github-pages/-/ember-cli-github-pages-0.1.2.tgz#83b11d307858595582ba61e90602209a37d5b348" +ember-cli-github-pages@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/ember-cli-github-pages/-/ember-cli-github-pages-0.2.0.tgz#2789d178936d8a1350ebbb1a300ab90760a111da" dependencies: - ember-cli-babel "^5.1.3" - ember-cli-version-checker "^1.1.6" - rsvp "^3.0.14" + ember-cli-version-checker "^2.1.0" + rsvp "^4.7.0" ember-cli-htmlbars-inline-precompile@^1.0.0: version "1.0.2" @@ -2893,7 +2980,7 @@ ember-cli-htmlbars@^1.0.0, ember-cli-htmlbars@^1.1.1: json-stable-stringify "^1.0.0" strip-bom "^2.0.0" -ember-cli-htmlbars@^2.0.3: +ember-cli-htmlbars@^2.0.1, ember-cli-htmlbars@^2.0.2, ember-cli-htmlbars@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/ember-cli-htmlbars/-/ember-cli-htmlbars-2.0.3.tgz#e116e1500dba12f29c94b05b9ec90f52cb8bb042" dependencies: @@ -2914,37 +3001,6 @@ ember-cli-is-package-missing@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/ember-cli-is-package-missing/-/ember-cli-is-package-missing-1.0.0.tgz#6e6184cafb92635dd93ca6c946b104292d4e3390" -ember-cli-legacy-blueprints@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/ember-cli-legacy-blueprints/-/ember-cli-legacy-blueprints-0.2.1.tgz#480f37cb83f1eda2d46bbc7d07c59ea2e8ce9b84" - dependencies: - chalk "^2.3.0" - ember-cli-get-component-path-option "^1.0.0" - ember-cli-get-dependency-depth "^1.0.0" - ember-cli-is-package-missing "^1.0.0" - ember-cli-lodash-subset "^2.0.1" - ember-cli-normalize-entity-name "^1.0.0" - ember-cli-path-utils "^1.0.0" - ember-cli-string-utils "^1.0.0" - ember-cli-test-info "^1.0.0" - ember-cli-valid-component-name "^1.0.0" - ember-cli-version-checker "^2.1.0" - ember-router-generator "^1.0.0" - exists-sync "0.0.3" - fs-extra "^4.0.0" - inflection "^1.7.1" - rsvp "^4.7.0" - silent-error "^1.0.0" - -ember-cli-less@1.5.4: - version "1.5.4" - resolved "https://registry.yarnpkg.com/ember-cli-less/-/ember-cli-less-1.5.4.tgz#4cfbc05c6f23712fe9665f93be9bc8f2cccb0f71" - dependencies: - broccoli-less-single "^0.6.4" - broccoli-merge-trees "^1.0.0" - ember-cli-version-checker "^1.1.4" - lodash.merge "^3.3.2" - ember-cli-lodash-subset@^1.0.7: version "1.0.12" resolved "https://registry.yarnpkg.com/ember-cli-lodash-subset/-/ember-cli-lodash-subset-1.0.12.tgz#af2e77eba5dcb0d77f3308d3a6fd7d3450f6e537" @@ -2969,7 +3025,18 @@ ember-cli-moment-shim@^3.3.3: moment "^2.18.1" moment-timezone "~0.5.11" -ember-cli-normalize-entity-name@^1.0.0: +ember-cli-node-assets@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/ember-cli-node-assets/-/ember-cli-node-assets-0.2.2.tgz#d2d55626e7cc6619f882d7fe55751f9266022708" + dependencies: + broccoli-funnel "^1.0.1" + broccoli-merge-trees "^1.1.1" + broccoli-source "^1.1.0" + debug "^2.2.0" + lodash "^4.5.1" + resolve "^1.1.7" + +ember-cli-normalize-entity-name@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/ember-cli-normalize-entity-name/-/ember-cli-normalize-entity-name-1.0.0.tgz#0b14f7bcbc599aa117b5fddc81e4fd03c4bad5b7" dependencies: @@ -3015,6 +3082,15 @@ ember-cli-release@1.0.0-beta.2: semver "^4.3.1" silent-error "^1.0.0" +ember-cli-sass@^7.1.7: + version "7.1.7" + resolved "https://registry.yarnpkg.com/ember-cli-sass/-/ember-cli-sass-7.1.7.tgz#66899134788ec8d2406a45f5346d4db47a2aa012" + dependencies: + broccoli-funnel "^1.0.0" + broccoli-merge-trees "^1.1.0" + broccoli-sass-source-maps "^2.1.0" + ember-cli-version-checker "^2.1.0" + ember-cli-shims@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/ember-cli-shims/-/ember-cli-shims-1.2.0.tgz#0f53aff0aab80b5f29da3a9731bac56169dd941f" @@ -3060,7 +3136,7 @@ ember-cli-valid-component-name@^1.0.0: dependencies: silent-error "^1.0.0" -ember-cli-version-checker@1.3.1, ember-cli-version-checker@^1.0.2, ember-cli-version-checker@^1.1.4, ember-cli-version-checker@^1.1.6: +ember-cli-version-checker@1.3.1, ember-cli-version-checker@^1.0.2: version "1.3.1" resolved "https://registry.yarnpkg.com/ember-cli-version-checker/-/ember-cli-version-checker-1.3.1.tgz#0bc2d134c830142da64bf9627a0eded10b61ae72" dependencies: @@ -3090,16 +3166,15 @@ ember-cli-yuidoc@^0.8.8: rsvp "3.0.14" yuidocjs "^0.10.0" -ember-cli@~2.18.2: - version "2.18.2" - resolved "https://registry.yarnpkg.com/ember-cli/-/ember-cli-2.18.2.tgz#bb15313a15139a85248a86d203643f918ba40f57" +ember-cli@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/ember-cli/-/ember-cli-3.0.2.tgz#2272a2b2ffd9932cae247130d148aded60b446e7" dependencies: amd-name-resolver "1.0.0" babel-plugin-transform-es2015-modules-amd "^6.24.0" bower-config "^1.3.0" bower-endpoint-parser "0.2.2" broccoli-babel-transpiler "^6.0.0" - broccoli-brocfile-loader "^0.18.0" broccoli-builder "^0.18.8" broccoli-concat "^3.2.2" broccoli-config-loader "^1.0.0" @@ -3108,7 +3183,7 @@ ember-cli@~2.18.2: broccoli-funnel "^2.0.0" broccoli-funnel-reducer "^1.0.0" broccoli-merge-trees "^2.0.0" - broccoli-middleware "^1.0.0" + broccoli-middleware "^1.2.1" broccoli-source "^1.1.0" broccoli-stew "^1.2.0" calculate-cache-key-for-tree "^1.0.0" @@ -3117,18 +3192,16 @@ ember-cli@~2.18.2: clean-base-url "^1.0.0" compression "^1.4.4" configstore "^3.0.0" - console-ui "^2.0.0" + console-ui "^2.1.0" core-object "^3.1.3" dag-map "^2.0.2" diff "^3.2.0" ember-cli-broccoli-sane-watcher "^2.0.4" ember-cli-is-package-missing "^1.0.0" - ember-cli-legacy-blueprints "^0.2.0" ember-cli-lodash-subset "^2.0.1" ember-cli-normalize-entity-name "^1.0.0" ember-cli-preprocess-registry "^3.1.0" ember-cli-string-utils "^1.0.0" - ember-try "^0.2.15" ensure-posix-path "^1.0.2" execa "^0.8.0" exists-sync "0.0.4" @@ -3177,20 +3250,43 @@ ember-cli@~2.18.2: uuid "^3.0.0" validate-npm-package-name "^3.0.0" walk-sync "^0.3.0" + watch-detector "^0.1.0" yam "0.0.22" -ember-code-snippet@^1.7.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/ember-code-snippet/-/ember-code-snippet-1.9.0.tgz#539e3316bd785544760b9c5090176b2fa3a3f142" +ember-code-snippet@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/ember-code-snippet/-/ember-code-snippet-2.0.1.tgz#59147f874a1d725a8aa84d820f6274e6aff083b9" dependencies: - broccoli-browserify "^0.1.0" - broccoli-flatiron "^0.0.0" + broccoli-flatiron "^0.1.2" broccoli-merge-trees "^1.0.0" broccoli-static-compiler "^0.1.4" broccoli-writer "^0.1.1" es6-promise "^1.0.0" glob "^4.0.4" - highlight.js "^9.5.0" + +ember-compatibility-helpers@^0.1.0, ember-compatibility-helpers@^0.1.2, ember-compatibility-helpers@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/ember-compatibility-helpers/-/ember-compatibility-helpers-0.1.3.tgz#039a57e9f1a401efda0023c1e3650bd01cfd7087" + dependencies: + babel-plugin-debug-macros "^0.1.11" + ember-cli-version-checker "^2.0.0" + semver "^5.4.1" + +ember-compatibility-helpers@^1.0.0-beta.2: + version "1.0.0-beta.2" + resolved "https://registry.yarnpkg.com/ember-compatibility-helpers/-/ember-compatibility-helpers-1.0.0-beta.2.tgz#00cb134af45f9562fa47a23f4da81a63aad41943" + dependencies: + babel-plugin-debug-macros "^0.1.11" + ember-cli-version-checker "^2.0.0" + semver "^5.4.1" + +ember-concurrency@^0.8.7: + version "0.8.17" + resolved "https://registry.yarnpkg.com/ember-concurrency/-/ember-concurrency-0.8.17.tgz#be47a90342f1960f4f57284c2fe5f7ce2396142a" + dependencies: + babel-core "^6.24.1" + ember-cli-babel "^6.8.2" + ember-maybe-import-regenerator "^0.1.5" ember-data@^2.18.0: version "2.18.0" @@ -3226,6 +3322,16 @@ ember-data@^2.18.0: semver "^5.1.0" silent-error "^1.0.0" +ember-decorators@^1.3.2: + version "1.3.4" + resolved "https://registry.yarnpkg.com/ember-decorators/-/ember-decorators-1.3.4.tgz#801115ae1be9157bbb75280991ee3d07d12c6cce" + dependencies: + "@ember-decorators/babel-transforms" "^0.1.1" + "@ember-decorators/utils" "^0.2.0" + ember-cli-babel "^6.0.0" + ember-compatibility-helpers "^0.1.0" + ember-macro-helpers "^0.17.0" + ember-disable-prototype-extensions@^1.1.2: version "1.1.3" resolved "https://registry.yarnpkg.com/ember-disable-prototype-extensions/-/ember-disable-prototype-extensions-1.1.3.tgz#1969135217654b5e278f9fe2d9d4e49b5720329e" @@ -3246,19 +3352,51 @@ ember-font-awesome@^3.0.5: ember-cli-htmlbars "^1.1.1" font-awesome "^4.7.0" +ember-get-config@^0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/ember-get-config/-/ember-get-config-0.2.4.tgz#118492a2a03d73e46004ed777928942021fe1ecd" + dependencies: + broccoli-file-creator "^1.1.1" + ember-cli-babel "^6.3.0" + +ember-in-element-polyfill@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ember-in-element-polyfill/-/ember-in-element-polyfill-0.1.2.tgz#6a73423869e0f330c40a48d75a71d1c36161cbd6" + dependencies: + debug "^3.1.0" + ember-cli-babel "^6.6.0" + ember-cli-version-checker "^2.1.0" + ember-wormhole "^0.5.4" + ember-inflector@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/ember-inflector/-/ember-inflector-2.1.0.tgz#afcb92d022a4eab58f08ff4578eafc3a1de2d09b" dependencies: ember-cli-babel "^6.0.0" +ember-legacy-class-shim@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/ember-legacy-class-shim/-/ember-legacy-class-shim-1.0.3.tgz#ce5a0e59a095e73f734cd341e2a5dbf08af85ed3" + dependencies: + browserslist "^3.1.0" + ember-cli-version-checker "^2.0.0" + ember-load-initializers@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/ember-load-initializers/-/ember-load-initializers-1.0.0.tgz#4919eaf06f6dfeca7e134633d8c05a6c9921e6e7" dependencies: ember-cli-babel "^6.0.0-beta.7" -ember-maybe-import-regenerator@^0.1.6: +ember-macro-helpers@^0.17.0: + version "0.17.0" + resolved "https://registry.yarnpkg.com/ember-macro-helpers/-/ember-macro-helpers-0.17.0.tgz#5e64a49f476e38c1916aff75f949455533cd1abe" + dependencies: + ember-cli-babel "^6.6.0" + ember-cli-string-utils "^1.1.0" + ember-cli-test-info "^1.0.0" + ember-weakmap "^3.0.0" + +ember-maybe-import-regenerator@^0.1.5, ember-maybe-import-regenerator@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/ember-maybe-import-regenerator/-/ember-maybe-import-regenerator-0.1.6.tgz#35d41828afa6d6a59bc0da3ce47f34c573d776ca" dependencies: @@ -3267,6 +3405,32 @@ ember-maybe-import-regenerator@^0.1.6: ember-cli-babel "^6.0.0-beta.4" regenerator-runtime "^0.9.5" +ember-maybe-in-element@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/ember-maybe-in-element/-/ember-maybe-in-element-0.1.3.tgz#1c89be49246e580c1090336ad8be31e373f71b60" + dependencies: + ember-cli-babel "^6.11.0" + +ember-popper@^0.8.3: + version "0.8.3" + resolved "https://registry.yarnpkg.com/ember-popper/-/ember-popper-0.8.3.tgz#547ec0e8d810805bd65bce7556f0a3377cb9730c" + dependencies: + "@ember-decorators/argument" "^0.8.10" + "@ember-decorators/babel-transforms" "^0.1.1" + babel-eslint "^8.0.3" + babel6-plugin-strip-class-callcheck "^6.0.0" + broccoli-funnel "^2.0.0" + ember-cli-babel "^6.10.0" + ember-cli-htmlbars "^2.0.3" + ember-cli-node-assets "^0.2.2" + ember-cli-version-checker "^2.1.0" + ember-compatibility-helpers "^0.1.3" + ember-decorators "^1.3.2" + ember-legacy-class-shim "^1.0.0" + ember-raf-scheduler "^0.1.0" + fastboot-transform "^0.1.0" + popper.js "^1.12.9" + ember-qunit-nice-errors@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/ember-qunit-nice-errors/-/ember-qunit-nice-errors-1.2.0.tgz#8db4468fbe761f42bec9adcddfd21efa31237267" @@ -3288,6 +3452,12 @@ ember-qunit@^3.3.0: ember-cli-test-loader "^2.2.0" qunit "^2.5.0" +ember-raf-scheduler@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/ember-raf-scheduler/-/ember-raf-scheduler-0.1.0.tgz#a22a02d238c374499231c03ab9c5b9887c72a853" + dependencies: + ember-cli-babel "^6.6.0" + ember-require-module@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/ember-require-module/-/ember-require-module-0.2.0.tgz#eafe436737ead4762220a9166b78364abf754274" @@ -3314,7 +3484,7 @@ ember-rfc176-data@^0.3.0, ember-rfc176-data@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/ember-rfc176-data/-/ember-rfc176-data-0.3.1.tgz#6a5a4b8b82ec3af34f3010965fa96b936ca94519" -ember-router-generator@^1.0.0, ember-router-generator@^1.2.3: +ember-router-generator@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/ember-router-generator/-/ember-router-generator-1.2.3.tgz#8ed2ca86ff323363120fc14278191e9e8f1315ee" dependencies: @@ -3327,9 +3497,15 @@ ember-runtime-enumerable-includes-polyfill@^2.0.0: ember-cli-babel "^6.9.0" ember-cli-version-checker "^2.1.0" -ember-source@~2.18.0: - version "2.18.0" - resolved "https://registry.yarnpkg.com/ember-source/-/ember-source-2.18.0.tgz#f61cf2701d8aa94a6adee6d47b1d5a73a4cef5f6" +ember-source-channel-url@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ember-source-channel-url/-/ember-source-channel-url-1.0.1.tgz#93517ccbd97a26220184b7986a5325317065308b" + dependencies: + got "^8.0.1" + +ember-source@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ember-source/-/ember-source-3.0.0.tgz#51811cae98d2ceec53bcfbaa876d02b2b5b2159f" dependencies: broccoli-funnel "^2.0.1" broccoli-merge-trees "^2.0.0" @@ -3338,7 +3514,6 @@ ember-source@~2.18.0: ember-cli-normalize-entity-name "^1.0.0" ember-cli-path-utils "^1.0.0" ember-cli-string-utils "^1.1.0" - ember-cli-test-info "^1.0.0" ember-cli-valid-component-name "^1.0.0" ember-cli-version-checker "^2.1.0" ember-router-generator "^1.2.3" @@ -3346,31 +3521,38 @@ ember-source@~2.18.0: jquery "^3.2.1" resolve "^1.3.3" -ember-truth-helpers@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/ember-truth-helpers/-/ember-truth-helpers-1.3.0.tgz#6ed9f83ce9a49f52bb416d55e227426339a64c60" +ember-test-selectors@^0.3.8: + version "0.3.8" + resolved "https://registry.yarnpkg.com/ember-test-selectors/-/ember-test-selectors-0.3.8.tgz#1e8ae3e78c64bacc4bbfe87f9973c85805699db2" dependencies: - ember-cli-babel "^5.1.6" + broccoli-stew "^1.4.0" + ember-cli-babel "^6.8.2" + ember-cli-version-checker "^2.0.0" -ember-try-config@^2.0.1: - version "2.1.0" - resolved "https://registry.yarnpkg.com/ember-try-config/-/ember-try-config-2.1.0.tgz#e0e156229a542346a58ee6f6ad605104c98edfe0" +ember-truth-helpers@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ember-truth-helpers/-/ember-truth-helpers-2.0.0.tgz#f3e2eef667859197f1328bb4f83b0b35b661c1ac" + dependencies: + ember-cli-babel "^6.8.2" + +ember-try-config@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/ember-try-config/-/ember-try-config-2.2.0.tgz#6be0af6c71949813e02ac793564fddbf8336b807" dependencies: lodash "^4.6.1" node-fetch "^1.3.3" rsvp "^3.2.1" semver "^5.1.0" -ember-try@^0.2.15: - version "0.2.16" - resolved "https://registry.yarnpkg.com/ember-try/-/ember-try-0.2.16.tgz#cf7092d8a8fea9701d7faa73cbdbff37a8ada330" +ember-try@^0.2.23: + version "0.2.23" + resolved "https://registry.yarnpkg.com/ember-try/-/ember-try-0.2.23.tgz#39b57141b4907541d0ac8b503d211e6946b08718" dependencies: chalk "^1.0.0" cli-table2 "^0.2.0" core-object "^1.1.0" debug "^2.2.0" - ember-cli-version-checker "^1.1.6" - ember-try-config "^2.0.1" + ember-try-config "^2.2.0" extend "^3.0.0" fs-extra "^0.26.0" promise-map-series "^0.2.1" @@ -3386,6 +3568,21 @@ ember-validators@^1.1.1: ember-cli-babel "^6.9.2" ember-require-module "^0.2.0" +ember-weakmap@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/ember-weakmap/-/ember-weakmap-3.1.1.tgz#2ae6e0080b5b80cf0d108f7752dc69ea9603dbd7" + dependencies: + browserslist "^2.2.2" + debug "^3.1.0" + ember-cli-babel "^6.3.0" + +ember-wormhole@^0.5.4: + version "0.5.4" + resolved "https://registry.yarnpkg.com/ember-wormhole/-/ember-wormhole-0.5.4.tgz#968e80f093494f4aed266e750afa63919c61383d" + dependencies: + ember-cli-babel "^6.10.0" + ember-cli-htmlbars "^2.0.1" + encodeurl@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" @@ -3443,12 +3640,6 @@ entities@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0" -errno@^0.1.1: - version "0.1.4" - resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.4.tgz#b896e23a9e5e8ba33871fc996abd3635fc9a1c7d" - dependencies: - prr "~0.0.0" - error-ex@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" @@ -3528,22 +3719,6 @@ escodegen@1.8.x, escodegen@^1.8.0: optionalDependencies: source-map "~0.2.0" -escodegen@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.1.0.tgz#c663923f6e20aad48d0c0fa49f31c6d4f49360cf" - dependencies: - esprima "~1.0.4" - estraverse "~1.5.0" - esutils "~1.0.0" - optionalDependencies: - source-map "~0.1.30" - -escope@~0.0.13: - version "0.0.16" - resolved "https://registry.yarnpkg.com/escope/-/escope-0.0.16.tgz#418c7a0afca721dafe659193fd986283e746538f" - dependencies: - estraverse ">= 0.0.2" - eslint-config-prettier@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-2.9.0.tgz#5ecd65174d486c22dff389fe036febf502d468a3" @@ -3574,7 +3749,7 @@ eslint-plugin-prettier@^2.6.0: fast-diff "^1.1.1" jest-docblock "^21.0.0" -eslint-scope@^3.7.1: +eslint-scope@^3.7.1, eslint-scope@~3.7.1: version "3.7.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" dependencies: @@ -3634,10 +3809,6 @@ espree@^3.5.2: acorn "^5.4.0" acorn-jsx "^3.0.0" -esprima-fb@3001.1.0-dev-harmony-fb, esprima-fb@^3001.1.0-dev-harmony-fb: - version "3001.1.0-dev-harmony-fb" - resolved "https://registry.yarnpkg.com/esprima-fb/-/esprima-fb-3001.0001.0000-dev-harmony-fb.tgz#b77d37abcd38ea0b77426bb8bc2922ce6b426411" - esprima-fb@~15001.1001.0-dev-harmony-fb: version "15001.1001.0-dev-harmony-fb" resolved "https://registry.yarnpkg.com/esprima-fb/-/esprima-fb-15001.1001.0-dev-harmony-fb.tgz#43beb57ec26e8cf237d3dd8b33e42533577f2659" @@ -3654,10 +3825,6 @@ esprima@^4.0.0, esprima@~4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" -esprima@~1.0.2, esprima@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-1.0.4.tgz#9f557e08fc3b4d26ece9dd34f8fbf476b62585ad" - esprima@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.0.0.tgz#53cf247acda77313e551c3aa2e73342d3fb4f7d9" @@ -3675,38 +3842,18 @@ esrecurse@^4.1.0: estraverse "^4.1.0" object-assign "^4.0.1" -esrefactor@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/esrefactor/-/esrefactor-0.1.0.tgz#d142795a282339ab81e936b5b7a21b11bf197b13" - dependencies: - escope "~0.0.13" - esprima "~1.0.2" - estraverse "~0.0.4" - -"estraverse@>= 0.0.2", estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: - version "4.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" - estraverse@^1.9.1: version "1.9.3" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" -estraverse@~0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-0.0.4.tgz#01a0932dfee574684a598af5a67c3bf9b6428db2" - -estraverse@~1.5.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.5.1.tgz#867a3e8e58a9f84618afb6c2ddbcd916b7cbaf71" +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: + version "4.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" esutils@^2.0.0, esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" -esutils@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-1.0.0.tgz#8151d358e20c8acc7fb745e7472c0025fe496570" - etag@~1.8.0, etag@~1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" @@ -3726,10 +3873,6 @@ events-to-array@^1.0.1: version "1.1.2" resolved "https://registry.yarnpkg.com/events-to-array/-/events-to-array-1.1.2.tgz#2d41f563e1fe400ed4962fe1a4d5c6a7539df7f6" -events@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/events/-/events-1.0.2.tgz#75849dcfe93d10fb057c30055afdbd51d06a8e24" - exec-file-sync@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/exec-file-sync/-/exec-file-sync-2.0.2.tgz#58d441db46e40de6d1f30de5be022785bd89e328" @@ -3987,6 +4130,13 @@ fast-sourcemap-concat@^1.0.1: source-map "^0.4.2" source-map-url "^0.3.0" +fastboot-transform@^0.1.0: + version "0.1.3" + resolved "https://registry.yarnpkg.com/fastboot-transform/-/fastboot-transform-0.1.3.tgz#7dea0b117594afd8772baa6c9b0919644e7f7dcd" + dependencies: + broccoli-stew "^1.5.0" + convert-source-map "^1.5.1" + faye-websocket@~0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.10.0.tgz#4e492f8d04dfb6f89003507f6edbf2d501e7c6f4" @@ -4096,9 +4246,9 @@ findup-sync@2.0.0: micromatch "^3.0.4" resolve-dir "^1.0.1" -findup-sync@^0.4.2: - version "0.4.3" - resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-0.4.3.tgz#40043929e7bc60adf0b7f4827c4c6e75a0deca12" +findup-sync@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-1.0.0.tgz#6f7e4b57b6ee3a4037b4414eaedea3f58f71e0ec" dependencies: detect-file "^0.1.0" is-glob "^2.0.1" @@ -4188,6 +4338,13 @@ fresh@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" +from2@^2.1.1: + version "2.3.0" + resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.0" + fs-exists-sync@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz#982d6893af918e72d08dec9e8673ff2b5a8d6add" @@ -4236,7 +4393,7 @@ fs-extra@^2.0.0: graceful-fs "^4.1.2" jsonfile "^2.1.0" -fs-extra@^4.0.0: +fs-extra@^4.0.0, fs-extra@^4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" dependencies: @@ -4343,6 +4500,12 @@ gauge@~2.7.3: strip-ansi "^3.0.1" wide-align "^1.1.0" +gaze@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/gaze/-/gaze-1.1.2.tgz#847224677adb8870d679257ed3388fdb61e40105" + dependencies: + globule "^1.0.0" + generate-function@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74" @@ -4353,7 +4516,7 @@ generate-object-property@^1.1.0: dependencies: is-property "^1.0.0" -get-caller-file@^1.0.0: +get-caller-file@^1.0.0, get-caller-file@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" @@ -4365,7 +4528,7 @@ get-stdin@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" -get-stream@^3.0.0: +get-stream@3.0.0, get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" @@ -4454,31 +4617,24 @@ glob@^5.0.10, glob@^5.0.15: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.3, glob@^7.0.4, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2: - version "7.1.2" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" +glob@^6.0.4, glob@~6.0.3: + version "6.0.4" + resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22" dependencies: - fs.realpath "^1.0.0" inflight "^1.0.4" inherits "2" - minimatch "^3.0.4" + minimatch "2 || 3" once "^1.3.0" path-is-absolute "^1.0.0" -glob@~3.2.8: - version "3.2.11" - resolved "https://registry.yarnpkg.com/glob/-/glob-3.2.11.tgz#4a973f635b9190f715d10987d5c00fd2815ebe3d" - dependencies: - inherits "2" - minimatch "0.3" - -glob@~6.0.3: - version "6.0.4" - resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22" +glob@^7.0.0, glob@^7.0.3, glob@^7.0.4, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@~7.1.1: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" dependencies: + fs.realpath "^1.0.0" inflight "^1.0.4" inherits "2" - minimatch "2 || 3" + minimatch "^3.0.4" once "^1.3.0" path-is-absolute "^1.0.0" @@ -4520,6 +4676,10 @@ globals@^11.0.1: version "11.3.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.3.0.tgz#e04fdb7b9796d8adac9c8f64c14837b2313378b0" +globals@^11.1.0: + version "11.4.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.4.0.tgz#b85c793349561c16076a3c13549238a27945f1bc" + globals@^6.4.0: version "6.4.1" resolved "https://registry.yarnpkg.com/globals/-/globals-6.4.1.tgz#8498032b3b6d1cc81eebc5f79690d8fe29fabf4f" @@ -4539,6 +4699,36 @@ globby@^5.0.0: pify "^2.0.0" pinkie-promise "^2.0.0" +globule@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/globule/-/globule-1.2.0.tgz#1dc49c6822dd9e8a2fa00ba2a295006e8664bd09" + dependencies: + glob "~7.1.1" + lodash "~4.17.4" + minimatch "~3.0.2" + +got@^8.0.1: + version "8.3.0" + resolved "https://registry.yarnpkg.com/got/-/got-8.3.0.tgz#6ba26e75f8a6cc4c6b3eb1fe7ce4fec7abac8533" + dependencies: + "@sindresorhus/is" "^0.7.0" + cacheable-request "^2.1.1" + decompress-response "^3.3.0" + duplexer3 "^0.1.4" + get-stream "^3.0.0" + into-stream "^3.1.0" + is-retry-allowed "^1.1.0" + isurl "^1.0.0-alpha5" + lowercase-keys "^1.0.0" + mimic-response "^1.0.0" + p-cancelable "^0.4.0" + p-timeout "^2.0.1" + pify "^3.0.0" + safe-buffer "^5.1.1" + timed-out "^4.0.1" + url-parse-lax "^3.0.0" + url-to-options "^1.0.1" + graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.4, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@~4.1.2: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" @@ -4565,7 +4755,7 @@ har-schema@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" -har-validator@~2.0.2: +har-validator@~2.0.2, har-validator@~2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d" dependencies: @@ -4617,6 +4807,20 @@ has-flag@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + +has-symbol-support-x@^1.4.1: + version "1.4.2" + resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" + +has-to-string-tag-x@^1.2.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz#a045ab383d7b4b2012a00148ab0aa5f290044d4d" + dependencies: + has-symbol-support-x "^1.4.1" + has-unicode@^2.0.0, has-unicode@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -4686,7 +4890,7 @@ heimdalljs-graph@^0.3.1: version "0.3.3" resolved "https://registry.yarnpkg.com/heimdalljs-graph/-/heimdalljs-graph-0.3.3.tgz#ea801dbba659c8d522fe1cb83b2d605726e4918f" -heimdalljs-logger@^0.1.7: +heimdalljs-logger@^0.1.7, heimdalljs-logger@^0.1.9: version "0.1.9" resolved "https://registry.yarnpkg.com/heimdalljs-logger/-/heimdalljs-logger-0.1.9.tgz#d76ada4e45b7bb6f786fc9c010a68eb2e2faf176" dependencies: @@ -4705,10 +4909,6 @@ heimdalljs@^0.3.0: dependencies: rsvp "~3.2.1" -highlight.js@^9.5.0: - version "9.12.0" - resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.12.0.tgz#e6d9dbe57cbefe60751f02af336195870c90c01e" - hoek@0.9.x: version "0.9.1" resolved "https://registry.yarnpkg.com/hoek/-/hoek-0.9.1.tgz#3d322462badf07716ea7eb85baf88079cddce505" @@ -4745,12 +4945,9 @@ hosted-git-info@~2.1.4: version "2.1.5" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.1.5.tgz#0ba81d90da2e25ab34a332e6ec77936e1598118b" -http-browserify@~1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/http-browserify/-/http-browserify-1.3.2.tgz#b562c34479349a690d7a6597df495aefa8c604f5" - dependencies: - Base64 "~0.2.0" - inherits "~2.0.1" +http-cache-semantics@3.8.1: + version "3.8.1" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2" http-errors@1.6.2, http-errors@~1.6.1, http-errors@~1.6.2: version "1.6.2" @@ -4784,10 +4981,6 @@ http-signature@~1.1.0: jsprim "^1.2.2" sshpk "^1.7.0" -https-browserify@~0.0.0: - version "0.0.1" - resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-0.0.1.tgz#3f91365cabe60b77ed0ebba24b454e3e09d95a82" - i@0.3.x: version "0.3.5" resolved "https://registry.yarnpkg.com/i/-/i-0.3.5.tgz#1d2b854158ec8169113c6cb7f6b6801e99e211d5" @@ -4804,10 +4997,6 @@ iconv-lite@^0.4.5, iconv-lite@~0.4.13: version "0.4.18" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.18.tgz#23d8656b16aae6742ac29732ea8f0336a4789cf2" -ieee754@~1.1.1: - version "1.1.8" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" - iferr@^0.1.5, iferr@~0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" @@ -4816,14 +5005,14 @@ ignore@^3.3.3, ignore@^3.3.6: version "3.3.7" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.7.tgz#612289bfb3c220e186a58118618d5be8c1bab021" -image-size@~0.5.0: - version "0.5.5" - resolved "https://registry.yarnpkg.com/image-size/-/image-size-0.5.5.tgz#09dfd4ab9d20e29eb1c3e80b8990378df9e3cb9c" - imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" +in-publish@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/in-publish/-/in-publish-2.0.0.tgz#e20ff5e3a2afc2690320b6dc552682a9c7fadf51" + include-path-searcher@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/include-path-searcher/-/include-path-searcher-0.1.0.tgz#c0cf2ddfa164fb2eae07bc7ca43a7f191cb4d7bd" @@ -4838,7 +5027,7 @@ indexof@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" -inflection@^1.12.0, inflection@^1.7.0, inflection@^1.7.1, inflection@^1.8.0: +inflection@^1.12.0, inflection@^1.7.0, inflection@^1.8.0: version "1.12.0" resolved "https://registry.yarnpkg.com/inflection/-/inflection-1.12.0.tgz#a200935656d6f5f6bc4dc7502e1aecb703228416" @@ -4853,10 +5042,6 @@ inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, i version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" -inherits@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" - ini@^1.3.4, ini@~1.3.0, ini@~1.3.4: version "1.3.4" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e" @@ -4884,12 +5069,6 @@ inline-source-map-comment@^1.0.5: sum-up "^1.0.1" xtend "^4.0.0" -inline-source-map@~0.3.0: - version "0.3.1" - resolved "https://registry.yarnpkg.com/inline-source-map/-/inline-source-map-0.3.1.tgz#a528b514e689fce90db3089e870d92f527acb5eb" - dependencies: - source-map "~0.3.0" - inquirer@^0.11.0: version "0.11.4" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.11.4.tgz#81e3374e8361beaff2d97016206d359d0b32fa4d" @@ -4946,16 +5125,18 @@ inquirer@^3.0.6: strip-ansi "^4.0.0" through "^2.3.6" -insert-module-globals@~6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/insert-module-globals/-/insert-module-globals-6.0.0.tgz#ee8aeb9dee16819e33aa14588a558824af0c15dc" +into-stream@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/into-stream/-/into-stream-3.1.0.tgz#96fb0a936c12babd6ff1752a17d05616abd094c6" + dependencies: + from2 "^2.1.1" + p-is-promise "^1.1.0" + +invariant@^2.2.0: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" dependencies: - JSONStream "~0.7.1" - concat-stream "~1.4.1" - lexical-scope "~1.1.0" - process "~0.6.0" - through "~2.3.4" - xtend "^3.0.0" + loose-envify "^1.0.0" invariant@^2.2.2: version "2.2.2" @@ -5126,6 +5307,10 @@ is-obj@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" +is-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.1.tgz#8952688c5ec2ffd6b03ecc85e769e02903083470" + is-odd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-odd/-/is-odd-1.0.0.tgz#3b8a932eb028b3775c39bb09e91767accdb69088" @@ -5148,6 +5333,10 @@ is-path-inside@^1.0.0: dependencies: path-is-inside "^1.0.1" +is-plain-obj@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" + is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" @@ -5176,6 +5365,10 @@ is-resolvable@^1.0.0: dependencies: tryit "^1.0.1" +is-retry-allowed@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" + is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -5259,6 +5452,13 @@ istextorbinary@2.1.0: editions "^1.1.1" textextensions "1 || 2" +isurl@^1.0.0-alpha5: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isurl/-/isurl-1.0.0.tgz#b27f4f49f3cdaa3ea44a0a5b7f3462e6edc39d67" + dependencies: + has-to-string-tag-x "^1.2.0" + is-object "^1.0.1" + jest-docblock@^21.0.0: version "21.2.0" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414" @@ -5267,14 +5467,14 @@ jju@^1.1.0: version "1.3.0" resolved "https://registry.yarnpkg.com/jju/-/jju-1.3.0.tgz#dadd9ef01924bc728b03f2f7979bdbd62f7a2aaa" -jquery@^2.2.4: - version "2.2.4" - resolved "https://registry.yarnpkg.com/jquery/-/jquery-2.2.4.tgz#2c89d6889b5eac522a7eea32c14521559c6cbf02" - jquery@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.2.1.tgz#5c4d9de652af6cd0a770154a631bba12b015c787" +js-base64@^2.1.8: + version "2.4.3" + resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.4.3.tgz#2e545ec2b0f2957f41356510205214e98fad6582" + js-base64@^2.1.9: version "2.1.9" resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.1.9.tgz#f0e80ae039a4bd654b5f281fc93f04a914a7fcce" @@ -5313,7 +5513,7 @@ jsesc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" -jsesc@^2.5.0: +jsesc@^2.5.0, jsesc@^2.5.1: version "2.5.1" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.1.tgz#e421a2a8e20d6b0819df28908f782526b96dd1fe" @@ -5321,6 +5521,10 @@ jsesc@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" +json-buffer@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" + json-parse-helpfulerror@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/json-parse-helpfulerror/-/json-parse-helpfulerror-1.0.3.tgz#13f14ce02eed4e981297b64eb9e3b932e2dd13dc" @@ -5377,10 +5581,6 @@ jsonify@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" -jsonparse@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-0.0.5.tgz#330542ad3f0a654665b778f3eb2d9a9fa507ac64" - jsonpointer@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" @@ -5394,6 +5594,12 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.3.6" +keyv@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.0.0.tgz#44923ba39e68b12a7cec7df6c3268c031f2ef373" + dependencies: + json-buffer "3.0.0" + kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" @@ -5444,19 +5650,6 @@ leek@0.0.24: lodash.assign "^3.2.0" rsvp "^3.0.21" -less@^2.5.0: - version "2.7.2" - resolved "https://registry.yarnpkg.com/less/-/less-2.7.2.tgz#368d6cc73e1fb03981183280918743c5dcf9b3df" - optionalDependencies: - errno "^0.1.1" - graceful-fs "^4.1.2" - image-size "~0.5.0" - mime "^1.2.11" - mkdirp "^0.5.0" - promise "^7.1.1" - request "^2.72.0" - source-map "^0.5.3" - leven@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/leven/-/leven-1.0.2.tgz#9144b6eebca5f1d0680169f1a6770dcea60b75c3" @@ -5468,12 +5661,6 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -lexical-scope@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/lexical-scope/-/lexical-scope-1.1.1.tgz#debac1067435f1359d90fcfd9e94bcb2ee47b2bf" - dependencies: - astw "^2.0.0" - linkify-it@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-2.0.3.tgz#d94a4648f9b1c179d64fa97291268bdb6ce9434f" @@ -5639,6 +5826,10 @@ lodash.assign@^3.2.0: lodash._createassigner "^3.0.0" lodash.keys "^3.0.0" +lodash.assign@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" + lodash.assignin@^4.1.0: version "4.2.0" resolved "https://registry.yarnpkg.com/lodash.assignin/-/lodash.assignin-4.2.0.tgz#ba8df5fb841eb0a3e8044232b0e263a8dc6a28a2" @@ -5647,7 +5838,7 @@ lodash.castarray@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.castarray/-/lodash.castarray-4.4.0.tgz#c02513515e309daddd4c24c60cfddcf5976d9115" -lodash.clonedeep@^4.4.1: +lodash.clonedeep@^4.3.2, lodash.clonedeep@^4.4.1: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" @@ -5691,14 +5882,6 @@ lodash.isarray@^3.0.0: version "3.0.4" resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" -lodash.isplainobject@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-3.2.0.tgz#9a8238ae16b200432960cd7346512d0123fbf4c5" - dependencies: - lodash._basefor "^3.0.0" - lodash.isarguments "^3.0.0" - lodash.keysin "^3.0.0" - lodash.istypedarray@^3.0.0: version "3.0.6" resolved "https://registry.yarnpkg.com/lodash.istypedarray/-/lodash.istypedarray-3.0.6.tgz#c9a477498607501d8e8494d283b87c39281cef62" @@ -5711,33 +5894,14 @@ lodash.keys@^3.0.0: lodash.isarguments "^3.0.0" lodash.isarray "^3.0.0" -lodash.keysin@^3.0.0: - version "3.0.8" - resolved "https://registry.yarnpkg.com/lodash.keysin/-/lodash.keysin-3.0.8.tgz#22c4493ebbedb1427962a54b445b2c8a767fb47f" - dependencies: - lodash.isarguments "^3.0.0" - lodash.isarray "^3.0.0" - -lodash.merge@^3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-3.3.2.tgz#0d90d93ed637b1878437bb3e21601260d7afe994" - dependencies: - lodash._arraycopy "^3.0.0" - lodash._arrayeach "^3.0.0" - lodash._createassigner "^3.0.0" - lodash._getnative "^3.0.0" - lodash.isarguments "^3.0.0" - lodash.isarray "^3.0.0" - lodash.isplainobject "^3.0.0" - lodash.istypedarray "^3.0.0" - lodash.keys "^3.0.0" - lodash.keysin "^3.0.0" - lodash.toplainobject "^3.0.0" - lodash.merge@^4.3.0, lodash.merge@^4.4.0, lodash.merge@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.0.tgz#69884ba144ac33fe699737a6086deffadd0f89c5" +lodash.mergewith@^4.6.0: + version "4.6.1" + resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz#639057e726c3afbdb3e7d42741caa8d6e4335927" + lodash.omit@^4.1.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.omit/-/lodash.omit-4.5.0.tgz#6eb19ae5a1ee1dd9df0b969e66ce0b7fa30b5e60" @@ -5777,13 +5941,6 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "~3.0.0" -lodash.toplainobject@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash.toplainobject/-/lodash.toplainobject-3.0.0.tgz#28790ad942d293d78aa663a07ecf7f52ca04198d" - dependencies: - lodash._basecopy "^3.0.0" - lodash.keysin "^3.0.0" - lodash.union@~3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/lodash.union/-/lodash.union-3.1.0.tgz#a4a3066fc15d6a7f8151cce9bdfe63dce7f5bcff" @@ -5829,11 +5986,11 @@ lodash@^4.0.0, lodash@^4.3.0, lodash@^4.6.1: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" -lodash@^4.14.0, lodash@^4.17.4: +lodash@^4.14.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.5.1, lodash@~4.17.4: version "4.17.5" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" -log-symbols@^2.1.0: +log-symbols@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" dependencies: @@ -5860,6 +6017,14 @@ lower-case@^1.1.1: version "1.1.4" resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac" +lowercase-keys@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306" + +lowercase-keys@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" + lru-cache@2: version "2.7.3" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952" @@ -5977,7 +6142,7 @@ memory-streams@^0.1.0: dependencies: readable-stream "~1.0.2" -meow@^3.4.0: +meow@^3.4.0, meow@^3.7.0: version "3.7.0" resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" dependencies: @@ -6059,12 +6224,22 @@ mime-db@~1.30.0: version "1.30.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.30.0.tgz#74c643da2dd9d6a45399963465b26d5ca7d71f01" +mime-db@~1.33.0: + version "1.33.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db" + mime-types@^2.1.11, mime-types@^2.1.12, mime-types@~2.1.7: version "2.1.16" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.16.tgz#2b858a52e5ecd516db897ac2be87487830698e23" dependencies: mime-db "~1.29.0" +mime-types@^2.1.18: + version "2.1.18" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8" + dependencies: + mime-db "~1.33.0" + mime-types@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-1.0.2.tgz#995ae1392ab8affcbfcb2641dd054e943c0d5dce" @@ -6095,12 +6270,9 @@ mimic-fn@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" -minimatch@0.3: - version "0.3.0" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-0.3.0.tgz#275d8edaac4f1bb3326472089e7949c8394699dd" - dependencies: - lru-cache "2" - sigmund "~1.0.0" +mimic-response@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.0.tgz#df3d3652a73fded6b9b0b24146e6fd052353458e" minimatch@1: version "1.0.0" @@ -6109,7 +6281,7 @@ minimatch@1: lru-cache "2" sigmund "~1.0.0" -"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: +"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4, minimatch@~3.0.2: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: @@ -6129,7 +6301,7 @@ minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" -minimist@~0.0.1, minimist@~0.0.7, minimist@~0.0.9: +minimist@~0.0.1: version "0.0.10" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" @@ -6154,23 +6326,6 @@ mktemp@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/mktemp/-/mktemp-0.4.0.tgz#6d0515611c8a8c84e484aa2000129b98e981ff0b" -module-deps@~2.0.0: - version "2.0.6" - resolved "https://registry.yarnpkg.com/module-deps/-/module-deps-2.0.6.tgz#b999321c73ac33580f00712c0f3075fdca42563f" - dependencies: - JSONStream "~0.7.1" - browser-resolve "~1.2.4" - concat-stream "~1.4.5" - detective "~3.1.0" - duplexer2 "0.0.2" - inherits "~2.0.1" - minimist "~0.0.9" - parents "0.0.2" - readable-stream "^1.0.27-1" - resolve "~0.6.3" - stream-combiner "~0.1.0" - through2 "~0.4.1" - moment-timezone@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.3.1.tgz#3ef47856b02d53b718a10a5ec2023aa299e07bf5" @@ -6235,6 +6390,10 @@ mute-stream@0.0.7, mute-stream@~0.0.4: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" +nan@^2.10.0: + version "2.10.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" + nan@^2.3.0: version "2.6.2" resolved "https://registry.yarnpkg.com/nan/-/nan-2.6.2.tgz#e4ff34e6c95fdfb5aecc08de6596f43605a7db45" @@ -6286,6 +6445,24 @@ node-fetch@^1.3.3: encoding "^0.1.11" is-stream "^1.0.1" +node-gyp@^3.3.1: + version "3.6.2" + resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.6.2.tgz#9bfbe54562286284838e750eac05295853fa1c60" + dependencies: + fstream "^1.0.0" + glob "^7.0.3" + graceful-fs "^4.1.2" + minimatch "^3.0.2" + mkdirp "^0.5.0" + nopt "2 || 3" + npmlog "0 || 1 || 2 || 3 || 4" + osenv "0" + request "2" + rimraf "2" + semver "~5.3.0" + tar "^2.0.0" + which "1" + node-gyp@~3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.2.1.tgz#f5dd569970a508464cc3c15d7e9e8d2de8638dd5" @@ -6352,6 +6529,30 @@ node-pre-gyp@^0.6.39: tar "^2.2.1" tar-pack "^3.4.0" +node-sass@^4.7.2: + version "4.8.3" + resolved "https://registry.yarnpkg.com/node-sass/-/node-sass-4.8.3.tgz#d077cc20a08ac06f661ca44fb6f19cd2ed41debb" + dependencies: + async-foreach "^0.1.3" + chalk "^1.1.1" + cross-spawn "^3.0.0" + gaze "^1.0.0" + get-stdin "^4.0.1" + glob "^7.0.3" + in-publish "^2.0.0" + lodash.assign "^4.2.0" + lodash.clonedeep "^4.3.2" + lodash.mergewith "^4.6.0" + meow "^3.7.0" + mkdirp "^0.5.1" + nan "^2.10.0" + node-gyp "^3.3.1" + npmlog "^4.0.0" + request "~2.79.0" + sass-graph "^2.2.4" + stdout-stream "^1.4.0" + "true-case-path" "^1.0.2" + node-uuid@~1.4.0, node-uuid@~1.4.7: version "1.4.8" resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.8.tgz#b040eb0923968afabf8d32fb1f17f1167fdab907" @@ -6401,6 +6602,14 @@ normalize-range@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" +normalize-url@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-2.0.1.tgz#835a9da1551fa26f70e92329069a23aa6574d7e6" + dependencies: + prepend-http "^2.0.0" + query-string "^5.0.1" + sort-keys "^2.0.0" + npm-cache-filename@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/npm-cache-filename/-/npm-cache-filename-1.0.2.tgz#ded306c5b0bfc870a9e9faf823bc5f283e05ae11" @@ -6559,7 +6768,7 @@ npm@~3.5.2: are-we-there-yet "~1.0.0" gauge "~1.2.0" -npmlog@^4.0.0, npmlog@^4.0.2: +"npmlog@0 || 1 || 2 || 3 || 4", npmlog@^4.0.0, npmlog@^4.0.2: version "4.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" dependencies: @@ -6600,6 +6809,10 @@ object-assign@4.1.1, object-assign@^4.0.1, object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" +object-assign@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-2.1.1.tgz#43c36e5d569ff8e4816c4efa8be02d26967c18aa" + object-component@0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/object-component/-/object-component-0.0.3.tgz#f0c69aa50efc95b866c186f400a33769cb2f1291" @@ -6612,10 +6825,6 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-keys@~0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-0.4.0.tgz#28a6aae7428dd2c3a92f3d95f21335dd204e0336" - object-visit@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" @@ -6678,12 +6887,6 @@ optimist@^0.6.1: minimist "~0.0.1" wordwrap "~0.0.2" -optimist@~0.3.5: - version "0.3.7" - resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.3.7.tgz#c90941ad59e4273328923074d2cf2e7cbc6ec0d9" - dependencies: - wordwrap "~0.0.2" - optionator@^0.8.1, optionator@^0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" @@ -6699,18 +6902,16 @@ options@>=0.0.5: version "0.0.6" resolved "https://registry.yarnpkg.com/options/-/options-0.0.6.tgz#ec22d312806bb53e731773e7cdaefcf1c643128f" -ora@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/ora/-/ora-1.4.0.tgz#884458215b3a5d4097592285f93321bb7a79e2e5" +ora@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ora/-/ora-2.0.0.tgz#8ec3a37fa7bffb54a3a0c188a1f6798e7e1827cd" dependencies: - chalk "^2.1.0" + chalk "^2.3.1" cli-cursor "^2.1.0" - cli-spinners "^1.0.1" - log-symbols "^2.1.0" - -os-browserify@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.1.2.tgz#49ca0293e0b19590a5f5de10c7f265a617d8fe54" + cli-spinners "^1.1.0" + log-symbols "^2.2.0" + strip-ansi "^4.0.0" + wcwidth "^1.0.1" os-homedir@^1.0.0, os-homedir@^1.0.1: version "1.0.2" @@ -6745,10 +6946,18 @@ output-file-sync@^1.1.0: mkdirp "^0.5.1" object-assign "^4.1.0" +p-cancelable@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.4.0.tgz#bcb41d35bf6097fc4367a065b6eb84b9b124eff0" + p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" +p-is-promise@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-1.1.0.tgz#9c9456989e9f6588017b0434d56097675c3da05e" + p-limit@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc" @@ -6759,19 +6968,11 @@ p-locate@^2.0.0: dependencies: p-limit "^1.1.0" -pako@~0.2.0: - version "0.2.9" - resolved "https://registry.yarnpkg.com/pako/-/pako-0.2.9.tgz#f3f7522f4ef782348da8161bad9ecfd51bf83a75" - -parents@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/parents/-/parents-0.0.2.tgz#67147826e497d40759aaf5ba4c99659b6034d302" - -parents@~0.0.1: - version "0.0.3" - resolved "https://registry.yarnpkg.com/parents/-/parents-0.0.3.tgz#fa212f024d9fa6318dbb6b4ce676c8be493b9c43" +p-timeout@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-2.0.1.tgz#d8dd1979595d2dc0139e1fe46b8b646cb3cdf038" dependencies: - path-platform "^0.0.1" + p-finally "^1.0.0" parse-glob@^3.0.4: version "3.0.4" @@ -6830,10 +7031,6 @@ path-array@^1.0.0: dependencies: array-index "^1.0.0" -path-browserify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" - path-exists@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-1.0.0.tgz#d5a8998eb71ef37a74c34eb0d9eba6e878eea081" @@ -6864,10 +7061,6 @@ path-parse@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" -path-platform@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/path-platform/-/path-platform-0.0.1.tgz#b5585d7c3c463d89aa0060d86611cf1afd617e2a" - path-posix@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/path-posix/-/path-posix-1.0.0.tgz#06b26113f56beab042545a23bfa88003ccac260f" @@ -6892,6 +7085,10 @@ pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + pinkie-promise@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" @@ -6914,6 +7111,10 @@ pluralize@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" +popper.js@^1.12.9: + version "1.14.1" + resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.14.1.tgz#b8815e5cda6f62fc2042e47618649f75866e6753" + portfinder@^1.0.7: version "1.0.13" resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.13.tgz#bb32ecd87c27104ae6ee44b5a3ccbf0ebb1aede9" @@ -6943,6 +7144,10 @@ prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" +prepend-http@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" + preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" @@ -6977,18 +7182,6 @@ process-relative-require@^1.0.0: dependencies: node-modules-path "^1.0.0" -process@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/process/-/process-0.7.0.tgz#c52208161a34adf3812344ae85d3e6150469389d" - -process@~0.5.1: - version "0.5.2" - resolved "https://registry.yarnpkg.com/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf" - -process@~0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/process/-/process-0.6.0.tgz#7dd9be80ffaaedd4cb628f1827f1cbab6dc0918f" - progress@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" @@ -6999,12 +7192,6 @@ promise-map-series@^0.2.1: dependencies: rsvp "^3.0.14" -promise@^7.1.1: - version "7.3.1" - resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" - dependencies: - asap "~2.0.3" - prompt@^0.2.14: version "0.2.14" resolved "https://registry.yarnpkg.com/prompt/-/prompt-0.2.14.tgz#57754f64f543fd7b0845707c818ece618f05ffdc" @@ -7039,26 +7226,14 @@ proxy-addr@~2.0.2: forwarded "~0.1.2" ipaddr.js "1.5.2" -prr@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a" - pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" -punycode@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" - punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" -punycode@~1.2.3: - version "1.2.4" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.2.4.tgz#54008ac972aec74175def9cba6df7fa9d3918740" - q@^1.1.2: version "1.5.0" resolved "https://registry.yarnpkg.com/q/-/q-1.5.0.tgz#dd01bac9d06d30e6f219aecb8253ee9ebdc308f1" @@ -7083,13 +7258,17 @@ qs@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/qs/-/qs-5.2.1.tgz#801fee030e0b9450d6385adc48a4cc55b44aedfc" -querystring-es3@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.0.tgz#c365a08a69c443accfeb3a9deab35e3f0abaa476" +qs@~6.3.0: + version "6.3.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.2.tgz#e75bd5f6e268122a2a0e0bda630b2550c166502c" -querystring@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" +query-string@^5.0.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.1.1.tgz#a78c012b71c17e05f2e3fa2319dd330682efb3cb" + dependencies: + decode-uri-component "^0.2.0" + object-assign "^4.1.0" + strict-uri-encode "^1.0.0" quick-temp@^0.1.0, quick-temp@^0.1.2, quick-temp@^0.1.3, quick-temp@^0.1.5, quick-temp@^0.1.8: version "0.1.8" @@ -7099,6 +7278,13 @@ quick-temp@^0.1.0, quick-temp@^0.1.2, quick-temp@^0.1.3, quick-temp@^0.1.5, quic rimraf "^2.5.4" underscore.string "~3.3.4" +qunit-dom@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/qunit-dom/-/qunit-dom-0.5.0.tgz#b08db6f919656e0589ebf8bd85bc313febb454d8" + dependencies: + broccoli-funnel "^2.0.0" + broccoli-merge-trees "^2.0.0" + qunit@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/qunit/-/qunit-2.5.0.tgz#64cbe30a1193ef02edc5b278efcdf1d0bae96b22" @@ -7228,15 +7414,6 @@ read@1, read@1.0.x, read@~1.0.1, read@~1.0.7: string_decoder "~1.0.3" util-deprecate "~1.0.1" -readable-stream@^1.0.27-1, readable-stream@~1.1.9: - version "1.1.14" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - readable-stream@^2, readable-stream@^2.0.6: version "2.3.4" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.4.tgz#c946c3f47fa7d8eabc0b6150f4a12f69a4574071" @@ -7249,7 +7426,19 @@ readable-stream@^2, readable-stream@^2.0.6: string_decoder "~1.0.3" util-deprecate "~1.0.1" -readable-stream@~1.0.17, readable-stream@~1.0.2: +readable-stream@^2.0.0, readable-stream@^2.0.1: + version "2.3.5" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.5.tgz#b4f85003a938cbb6ecbce2a124fb1012bd1a838d" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.0.3" + util-deprecate "~1.0.1" + +readable-stream@~1.0.2: version "1.0.34" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" dependencies: @@ -7329,6 +7518,16 @@ recast@^0.11.17, recast@^0.11.3: private "~0.1.5" source-map "~0.5.0" +recast@^0.12.0: + version "0.12.9" + resolved "https://registry.yarnpkg.com/recast/-/recast-0.12.9.tgz#e8e52bdb9691af462ccbd7c15d5a5113647a15f1" + dependencies: + ast-types "0.10.1" + core-js "^2.4.1" + esprima "~4.0.0" + private "~0.1.5" + source-map "~0.6.1" + recast@^0.13.0: version "0.13.1" resolved "https://registry.yarnpkg.com/recast/-/recast-0.13.1.tgz#e838ac26c47599606413ff4fe83617552069921d" @@ -7451,7 +7650,7 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" -request@2, request@2.81.0, request@^2.47.0, request@^2.72.0, request@^2.81.0: +request@2, request@2.81.0, request@^2.47.0, request@^2.81.0: version "2.81.0" resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" dependencies: @@ -7522,16 +7721,49 @@ request@~2.67.0: tough-cookie "~2.2.0" tunnel-agent "~0.4.1" +request@~2.79.0: + version "2.79.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" + dependencies: + aws-sign2 "~0.6.0" + aws4 "^1.2.1" + caseless "~0.11.0" + combined-stream "~1.0.5" + extend "~3.0.0" + forever-agent "~0.6.1" + form-data "~2.1.1" + har-validator "~2.0.6" + hawk "~3.1.3" + http-signature "~1.1.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.7" + oauth-sign "~0.8.1" + qs "~6.3.0" + stringstream "~0.0.4" + tough-cookie "~2.3.0" + tunnel-agent "~0.4.1" + uuid "^3.0.0" + require-dir@^0.3.0: version "0.3.2" resolved "https://registry.yarnpkg.com/require-dir/-/require-dir-0.3.2.tgz#c1d5c75e9fbffde9f2e6b33e383db4f594b5a6a9" +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + require-folder-tree@^1.4.5: version "1.4.5" resolved "https://registry.yarnpkg.com/require-folder-tree/-/require-folder-tree-1.4.5.tgz#dfe553cbab98cc88e1c56a3f2f358f06ef85bcb0" dependencies: lodash "3.8.0" +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + require-uncached@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" @@ -7565,10 +7797,6 @@ resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" -resolve@0.6.3, resolve@~0.6.1, resolve@~0.6.3: - version "0.6.3" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-0.6.3.tgz#dd957982e7e736debdf53b58a4dd91754575dd46" - resolve@1.1.x: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" @@ -7585,9 +7813,17 @@ resolve@^1.1.2, resolve@^1.3.0, resolve@^1.3.3: dependencies: path-parse "^1.0.5" -resolve@~0.3.0: - version "0.3.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-0.3.1.tgz#34c63447c664c70598d1c9b126fc43b2a24310a4" +resolve@^1.1.7: + version "1.6.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.6.0.tgz#0fbd21278b27b4004481c395349e7aba60a9ff5c" + dependencies: + path-parse "^1.0.5" + +responselike@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" + dependencies: + lowercase-keys "^1.0.0" restore-cursor@^1.0.1: version "1.0.1" @@ -7611,13 +7847,6 @@ revalidator@0.1.x: version "0.1.8" resolved "https://registry.yarnpkg.com/revalidator/-/revalidator-0.1.8.tgz#fece61bfa0c1b52a206bd6b18198184bdd523a3b" -rfile@~1.0, rfile@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/rfile/-/rfile-1.0.0.tgz#59708cf90ca1e74c54c3cfc5c36fdb9810435261" - dependencies: - callsite "~1.0.0" - resolve "~0.3.0" - right-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" @@ -7660,6 +7889,10 @@ rsvp@^3.0.14, rsvp@^3.0.16, rsvp@^3.0.17, rsvp@^3.0.18, rsvp@^3.0.21, rsvp@^3.0. version "3.6.2" resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-3.6.2.tgz#2e96491599a96cde1b515d5674a8f7a91452926a" +rsvp@^4.0.1: + version "4.8.2" + resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.2.tgz#9d5647108735784eb13418cdddb56f75b919d722" + rsvp@^4.6.1, rsvp@^4.7.0: version "4.8.1" resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.1.tgz#168addb3963222de37ee351b70e3876bdb2ac285" @@ -7672,13 +7905,6 @@ rsvp@~3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-3.2.1.tgz#07cb4a5df25add9e826ebc67dcc9fd89db27d84a" -ruglify@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/ruglify/-/ruglify-1.0.0.tgz#dc8930e2a9544a274301cc9972574c0d0986b675" - dependencies: - rfile "~1.0" - uglify-js "~2.2" - run-async@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389" @@ -7709,7 +7935,7 @@ rx@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782" -safe-buffer@5.1.1, safe-buffer@^5.0.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: +safe-buffer@5.1.1, safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" @@ -7743,11 +7969,27 @@ sane@^2.2.0: optionalDependencies: fsevents "^1.1.1" +sass-graph@^2.2.4: + version "2.2.4" + resolved "https://registry.yarnpkg.com/sass-graph/-/sass-graph-2.2.4.tgz#13fbd63cd1caf0908b9fd93476ad43a51d1e0b49" + dependencies: + glob "^7.0.0" + lodash "^4.0.0" + scss-tokenizer "^0.2.3" + yargs "^7.0.0" + +scss-tokenizer@^0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz#8eb06db9a9723333824d3f5530641149847ce5d1" + dependencies: + js-base64 "^2.1.8" + source-map "^0.4.2" + "semver@2 >=2.2.1 || 3.x || 4 || 5", "semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", "semver@4 || 5", "semver@^2.3.0 || 3.x || 4 || 5", semver@^5.1.1, semver@^5.4.1: version "5.4.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" -semver@5.3.0: +semver@5.3.0, semver@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" @@ -7817,7 +8059,7 @@ serve-static@1.13.1: parseurl "~1.3.2" send "0.16.1" -set-blocking@~2.0.0: +set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -7864,10 +8106,6 @@ sha@~2.0.1: graceful-fs "^4.1.2" readable-stream "^2.0.2" -shallow-copy@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/shallow-copy/-/shallow-copy-0.0.1.tgz#415f42702d73d810330292cc5ee86eae1a11a170" - shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" @@ -7878,10 +8116,6 @@ shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" -shell-quote@~0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-0.0.1.tgz#1a41196f3c0333c482323593d6886ecf153dd986" - shelljs@^0.2.6: version "0.2.6" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.2.6.tgz#90492d72ffcc8159976baba62fb0f6884f0c3378" @@ -8015,6 +8249,12 @@ socket.io@1.6.0: socket.io-client "1.6.0" socket.io-parser "2.3.1" +sort-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-2.0.0.tgz#658535584861ec97d730d6cf41822e1f56684128" + dependencies: + is-plain-obj "^1.0.0" + sort-object-keys@^1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/sort-object-keys/-/sort-object-keys-1.1.2.tgz#d3a6c48dc2ac97e6bc94367696e03f6d09d37952" @@ -8065,19 +8305,13 @@ source-map@0.1.32: dependencies: amdefine ">=0.0.4" -source-map@0.1.34: - version "0.1.34" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.1.34.tgz#a7cfe89aec7b1682c3b198d0acfb47d7d090566b" - dependencies: - amdefine ">=0.0.4" - source-map@0.4.x, source-map@^0.4.2, source-map@^0.4.4: version "0.4.4" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" dependencies: amdefine ">=0.0.4" -source-map@0.5.6, source-map@^0.5.3, source-map@~0.5.0, source-map@~0.5.1: +source-map@0.5.6, source-map@~0.5.0, source-map@~0.5.1: version "0.5.6" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" @@ -8085,24 +8319,12 @@ source-map@^0.5.0, source-map@^0.5.6, source-map@^0.5.7: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" -source-map@~0.1.30, source-map@~0.1.31, source-map@~0.1.7: - version "0.1.43" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.1.43.tgz#c24bc146ca517c1471f5dacbe2571b2b7f9e3346" - dependencies: - amdefine ">=0.0.4" - source-map@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" dependencies: amdefine ">=0.0.4" -source-map@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.3.0.tgz#8586fb9a5a005e5b501e21cd18b6f21b457ad1f9" - dependencies: - amdefine ">=0.0.4" - source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" @@ -8191,25 +8413,15 @@ statuses@~1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" -stream-browserify@~0.1.0: - version "0.1.3" - resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-0.1.3.tgz#95cf1b369772e27adaf46352265152689c6c4be9" - dependencies: - inherits "~2.0.1" - process "~0.5.1" - -stream-combiner@~0.0.2: - version "0.0.4" - resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" +stdout-stream@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/stdout-stream/-/stdout-stream-1.4.0.tgz#a2c7c8587e54d9427ea9edb3ac3f2cd522df378b" dependencies: - duplexer "~0.1.1" + readable-stream "^2.0.1" -stream-combiner@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.1.0.tgz#0dc389a3c203f8f4d56368f95dde52eb9269b5be" - dependencies: - duplexer "~0.1.1" - through "~2.3.4" +strict-uri-encode@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" string-template@~0.2.1: version "0.2.1" @@ -8238,10 +8450,6 @@ string_decoder@0.10, string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" -string_decoder@~0.0.0: - version "0.0.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.0.1.tgz#f5472d0a8d1650ec823752d24e6fd627b39bf141" - string_decoder@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" @@ -8306,12 +8514,6 @@ styled_string@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/styled_string/-/styled_string-0.0.1.tgz#d22782bd81295459bc4f1df18c4bad8e94dd124a" -subarg@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/subarg/-/subarg-0.0.1.tgz#3d56b07dacfbc45bbb63f7672b43b63e46368e3a" - dependencies: - minimist "~0.0.7" - sum-up@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/sum-up/-/sum-up-1.0.3.tgz#1c661f667057f63bcb7875aa1438bc162525156e" @@ -8338,16 +8540,16 @@ supports-color@^4.0.0: dependencies: has-flag "^2.0.0" +supports-color@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.3.0.tgz#5b24ac15db80fa927cf5227a4a33fd3c4c7676c0" + dependencies: + has-flag "^3.0.0" + symlink-or-copy@^1.0.0, symlink-or-copy@^1.0.1, symlink-or-copy@^1.1.8: version "1.1.8" resolved "https://registry.yarnpkg.com/symlink-or-copy/-/symlink-or-copy-1.1.8.tgz#cabe61e0010c1c023c173b25ee5108b37f4b4aa3" -syntax-error@~1.1.0: - version "1.1.6" - resolved "https://registry.yarnpkg.com/syntax-error/-/syntax-error-1.1.6.tgz#b4549706d386cc1c1dc7c2423f18579b6cade710" - dependencies: - acorn "^2.7.0" - table@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" @@ -8436,26 +8638,13 @@ text-table@~0.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/textextensions/-/textextensions-2.2.0.tgz#38ac676151285b658654581987a0ce1a4490d286" -through2@~0.4.1: - version "0.4.2" - resolved "https://registry.yarnpkg.com/through2/-/through2-0.4.2.tgz#dbf5866031151ec8352bb6c4db64a2292a840b9b" - dependencies: - readable-stream "~1.0.17" - xtend "~2.1.1" - -"through@>=2.2.7 <3", through@^2.3.6, through@^2.3.8, through@~2.3.4, through@~2.3.8: +through@^2.3.6, through@^2.3.8, through@~2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" -through@~2.2.7: - version "2.2.7" - resolved "https://registry.yarnpkg.com/through/-/through-2.2.7.tgz#6e8e21200191d4eb6a99f6f010df46aa1c6eb2bd" - -timers-browserify@~1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-1.0.3.tgz#ffba70c9c12eed916fd67318e629ac6f32295551" - dependencies: - process "~0.5.1" +timed-out@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" tiny-lr@^1.0.3: version "1.0.5" @@ -8498,6 +8687,10 @@ to-fast-properties@^1.0.0, to-fast-properties@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + to-object-path@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" @@ -8547,6 +8740,12 @@ trim-right@^1.0.0, trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" +"true-case-path@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/true-case-path/-/true-case-path-1.0.2.tgz#7ec91130924766c7f573be3020c34f8fdfd00d62" + dependencies: + glob "^6.0.4" + try-resolve@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/try-resolve/-/try-resolve-1.0.1.tgz#cfde6fabd72d63e5797cfaab873abbe8e700e912" @@ -8559,10 +8758,6 @@ tryor@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/tryor/-/tryor-0.1.2.tgz#8145e4ca7caff40acde3ccf946e8b8bb75b4172b" -tty-browserify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" - tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -8590,7 +8785,7 @@ type-is@~1.6.15: media-typer "0.3.0" mime-types "~2.1.15" -typedarray@^0.0.6, typedarray@~0.0.5: +typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" @@ -8614,22 +8809,6 @@ uglify-js@^2.6: optionalDependencies: uglify-to-browserify "~1.0.0" -uglify-js@~2.2: - version "2.2.5" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.2.5.tgz#a6e02a70d839792b9780488b7b8b184c095c99c7" - dependencies: - optimist "~0.3.5" - source-map "~0.1.7" - -uglify-js@~2.4.0: - version "2.4.24" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.4.24.tgz#fad5755c1e1577658bb06ff9ab6e548c95bebd6e" - dependencies: - async "~0.2.6" - source-map "0.1.34" - uglify-to-browserify "~1.0.0" - yargs "~3.5.4" - uglify-to-browserify@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" @@ -8646,15 +8825,6 @@ umask@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/umask/-/umask-1.1.0.tgz#f29cebf01df517912bb58ff9c4e50fde8e33320d" -umd@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/umd/-/umd-2.0.0.tgz#749683b0d514728ae0e1b6195f5774afc0ad4f8f" - dependencies: - rfile "~1.0.0" - ruglify "~1.0.0" - through "~2.3.4" - uglify-js "~2.4.0" - underscore.string@~3.3.4: version "3.3.4" resolved "https://registry.yarnpkg.com/underscore.string/-/underscore.string-3.3.4.tgz#2c2a3f9f83e64762fdc45e6ceac65142864213db" @@ -8718,12 +8888,15 @@ urix@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" -url@~0.10.1: - version "0.10.3" - resolved "https://registry.yarnpkg.com/url/-/url-0.10.3.tgz#021e4d9c7705f21bbf37d03ceb58767402774c64" +url-parse-lax@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" dependencies: - punycode "1.3.2" - querystring "0.2.0" + prepend-http "^2.0.0" + +url-to-options@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9" use@^2.0.0: version "2.0.2" @@ -8763,12 +8936,6 @@ util-extend@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/util-extend/-/util-extend-1.0.3.tgz#a7c216d267545169637b3b6edc6ca9119e2ff93f" -util@0.10.3, util@~0.10.1: - version "0.10.3" - resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" - dependencies: - inherits "2.0.1" - utile@0.2.x: version "0.2.1" resolved "https://registry.yarnpkg.com/utile/-/utile-0.2.1.tgz#930c88e99098d6220834c356cbd9a770522d90d7" @@ -8825,12 +8992,6 @@ verror@1.3.6: dependencies: extsprintf "1.0.2" -vm-browserify@~0.0.1: - version "0.0.4" - resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" - dependencies: - indexof "0.0.1" - walk-sync@0.3.2, walk-sync@^0.3.0, walk-sync@^0.3.1, walk-sync@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/walk-sync/-/walk-sync-0.3.2.tgz#4827280afc42d0e035367c4a4e31eeac0d136f75" @@ -8851,6 +9012,16 @@ walker@~1.0.5: dependencies: makeerror "1.0.x" +watch-detector@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/watch-detector/-/watch-detector-0.1.0.tgz#e37b410d149e2a8bf263a4f8b71e2f667633dbf8" + dependencies: + heimdalljs-logger "^0.1.9" + quick-temp "^0.1.8" + rsvp "^4.7.0" + semver "^5.4.1" + silent-error "^1.1.0" + watch@~0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/watch/-/watch-0.10.0.tgz#77798b2da0f9910d595f1ace5b0c2258521f21dc" @@ -8862,7 +9033,7 @@ watch@~0.18.0: exec-sh "^0.2.0" minimist "^1.2.0" -wcwidth@^1.0.0: +wcwidth@^1.0.0, wcwidth@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" dependencies: @@ -8878,6 +9049,10 @@ websocket-extensions@>=0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.1.tgz#76899499c184b6ef754377c2dbb0cd6cb55d29e7" +which-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" + which@1, which@^1.1.1, which@~1.2.1: version "1.2.14" resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" @@ -8934,6 +9109,13 @@ workerpool@^2.2.1, workerpool@^2.3.0: dependencies: object-assign "4.1.1" +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrappy@1, wrappy@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -8983,21 +9165,11 @@ xmlhttprequest-ssl@1.5.3: version "1.5.3" resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.3.tgz#185a888c04eca46c3e4070d99f7b49de3528992d" -xtend@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-3.0.0.tgz#5cce7407baf642cba7becda568111c493f59665a" - xtend@^4.0.0, xtend@~4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" -xtend@~2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-2.1.2.tgz#6efecc2a4dad8e6962c4901b337ce7ba87b5d28b" - dependencies: - object-keys "~0.4.0" - -y18n@^3.2.0: +y18n@^3.2.0, y18n@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" @@ -9012,6 +9184,30 @@ yam@0.0.22: fs-extra "^0.30.0" lodash.merge "^4.4.0" +yargs-parser@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" + dependencies: + camelcase "^3.0.0" + +yargs@^7.0.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8" + dependencies: + camelcase "^3.0.0" + cliui "^3.2.0" + decamelize "^1.1.1" + get-caller-file "^1.0.1" + os-locale "^1.4.0" + read-pkg-up "^1.0.1" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^1.0.2" + which-module "^1.0.0" + y18n "^3.2.1" + yargs-parser "^5.0.0" + yargs@~3.10.0: version "3.10.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" @@ -9032,15 +9228,6 @@ yargs@~3.27.0: window-size "^0.1.2" y18n "^3.2.0" -yargs@~3.5.4: - version "3.5.4" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.5.4.tgz#d8aff8f665e94c34bd259bdebd1bfaf0ddd35361" - dependencies: - camelcase "^1.0.2" - decamelize "^1.0.0" - window-size "0.1.0" - wordwrap "0.0.2" - yeast@0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419"