MAINT: Upgrade to ember 2.16 LTS (#66)
This commit is contained in:
parent
39f4789a61
commit
eb4537afb1
45 changed files with 129 additions and 151 deletions
10
.travis.yml
10
.travis.yml
|
@ -3,11 +3,17 @@ branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
node_js:
|
node_js:
|
||||||
- '6'
|
- "6"
|
||||||
sudo: false
|
sudo: required
|
||||||
|
dist: trusty
|
||||||
|
addons:
|
||||||
|
chrome: stable
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- "$HOME/.npm"
|
- "$HOME/.npm"
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
- JOBS=1
|
||||||
before_install:
|
before_install:
|
||||||
- npm config set spin false
|
- npm config set spin false
|
||||||
- npm install -g phantomjs-prebuilt
|
- npm install -g phantomjs-prebuilt
|
||||||
|
|
|
@ -10,7 +10,7 @@ You will need the following things properly installed on your computer.
|
||||||
* [Git](https://git-scm.com/)
|
* [Git](https://git-scm.com/)
|
||||||
* [Node.js](https://nodejs.org/) (with NPM)
|
* [Node.js](https://nodejs.org/) (with NPM)
|
||||||
* [Ember CLI](https://ember-cli.com/)
|
* [Ember CLI](https://ember-cli.com/)
|
||||||
* [PhantomJS](http://phantomjs.org/)
|
* [Google Chrome](https://google.com/chrome/)
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
import Ember from 'ember';
|
import Application from '@ember/application';
|
||||||
import Resolver from './resolver';
|
import Resolver from './resolver';
|
||||||
import loadInitializers from 'ember-load-initializers';
|
import loadInitializers from 'ember-load-initializers';
|
||||||
import config from './config/environment';
|
import config from './config/environment';
|
||||||
|
|
||||||
let App;
|
const App = Application.extend({
|
||||||
|
|
||||||
App = Ember.Application.extend({
|
|
||||||
modulePrefix: config.modulePrefix,
|
modulePrefix: config.modulePrefix,
|
||||||
podModulePrefix: config.podModulePrefix,
|
podModulePrefix: config.podModulePrefix,
|
||||||
Resolver
|
Resolver
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
import Ember from 'ember';
|
import { Promise } from 'rsvp';
|
||||||
|
import $ from 'jquery';
|
||||||
|
import { get } from '@ember/object';
|
||||||
|
import { isEmpty } from '@ember/utils';
|
||||||
|
import { run } from '@ember/runloop';
|
||||||
import BaseAuthenticator from 'ember-simple-auth/authenticators/base';
|
import BaseAuthenticator from 'ember-simple-auth/authenticators/base';
|
||||||
import config from '../config/environment';
|
import config from '../config/environment';
|
||||||
|
|
||||||
const { RSVP: { Promise }, $, get, isEmpty, run } = Ember;
|
|
||||||
|
|
||||||
export default BaseAuthenticator.extend({
|
export default BaseAuthenticator.extend({
|
||||||
serverTokenEndpoint: `${config.APP.API_HOST}/api/auth/login/`,
|
serverTokenEndpoint: `${config.APP.API_HOST}/api/auth/login/`,
|
||||||
tokenAttributeName: 'data.attributes.auth-token',
|
tokenAttributeName: 'data.attributes.auth-token',
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import Ember from 'ember';
|
import { isEmpty } from '@ember/utils';
|
||||||
|
import { get } from '@ember/object';
|
||||||
import BaseAuthorizer from 'ember-simple-auth/authorizers/base';
|
import BaseAuthorizer from 'ember-simple-auth/authorizers/base';
|
||||||
|
|
||||||
const { isEmpty, get } = Ember;
|
|
||||||
|
|
||||||
export default BaseAuthorizer.extend({
|
export default BaseAuthorizer.extend({
|
||||||
authorize(data, block) {
|
authorize(data, block) {
|
||||||
const accessToken = get(data, 'data.attributes.auth-token');
|
const accessToken = get(data, 'data.attributes.auth-token');
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import Ember from 'ember';
|
import Component from '@ember/component';
|
||||||
|
|
||||||
const { Component } = Ember;
|
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
tagName: 'a',
|
tagName: 'a',
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
import Ember from 'ember';
|
import Component from '@ember/component';
|
||||||
|
|
||||||
const { Component } = Ember;
|
|
||||||
|
|
||||||
export default Component.extend({});
|
export default Component.extend({});
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
import Ember from 'ember';
|
import Component from '@ember/component';
|
||||||
|
|
||||||
const { Component } = Ember;
|
|
||||||
|
|
||||||
export default Component.extend({ });
|
export default Component.extend({ });
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import Ember from 'ember';
|
import Component from '@ember/component';
|
||||||
|
import { alias } from '@ember/object/computed';
|
||||||
const { Component, computed: { alias }, computed } = Ember;
|
import { computed } from '@ember/object';
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
// ARGS
|
// ARGS
|
||||||
|
@ -8,7 +8,7 @@ export default Component.extend({
|
||||||
|
|
||||||
// COMPUTED
|
// COMPUTED
|
||||||
meta: alias('model.meta'),
|
meta: alias('model.meta'),
|
||||||
links: alias('model.links'),
|
links: alias('meta.links'),
|
||||||
|
|
||||||
currentPage: alias('meta.pagination.page'),
|
currentPage: alias('meta.pagination.page'),
|
||||||
totalRecords: alias('meta.pagination.count'),
|
totalRecords: alias('meta.pagination.count'),
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
import Ember from 'ember';
|
import Component from '@ember/component';
|
||||||
import Table from 'ember-light-table';
|
import Table from 'ember-light-table';
|
||||||
|
|
||||||
const { Component } = Ember;
|
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
// ARGS
|
// ARGS
|
||||||
model: null,
|
model: null,
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import Ember from 'ember';
|
import Component from '@ember/component';
|
||||||
|
import { inject as service } from '@ember/service';
|
||||||
import Changeset from 'ember-changeset';
|
import Changeset from 'ember-changeset';
|
||||||
import lookupValidator from 'ember-changeset-validations';
|
import lookupValidator from 'ember-changeset-validations';
|
||||||
|
|
||||||
const { Component, inject: { service } } = Ember;
|
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
store: service(),
|
store: service(),
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import Ember from 'ember';
|
import Component from '@ember/component';
|
||||||
|
|
||||||
const { Component } = Ember;
|
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
// ARGS
|
// ARGS
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import Ember from 'ember';
|
import Component from '@ember/component';
|
||||||
|
|
||||||
const { Component } = Ember;
|
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
// ARGS
|
// ARGS
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import Ember from 'ember';
|
import Component from '@ember/component';
|
||||||
|
|
||||||
const { Component } = Ember;
|
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
// ARGS
|
// ARGS
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import Ember from 'ember';
|
import Component from '@ember/component';
|
||||||
|
|
||||||
const { Component } = Ember;
|
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
tagName: 'form',
|
tagName: 'form',
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import Ember from 'ember';
|
import Component from '@ember/component';
|
||||||
|
|
||||||
const { Component } = Ember;
|
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
classNames: ['spinner'],
|
classNames: ['spinner'],
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import Ember from 'ember';
|
import Component from '@ember/component';
|
||||||
|
import { get, computed } from '@ember/object';
|
||||||
const { Component, computed, get, isEmpty } = Ember;
|
import { isEmpty } from '@ember/utils';
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
classNames: ['form-group'],
|
classNames: ['form-group'],
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import Ember from 'ember';
|
import Controller from '@ember/controller';
|
||||||
|
import { inject as service } from '@ember/service';
|
||||||
const { Controller, inject: { service } } = Ember;
|
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
session: service('session'),
|
session: service('session'),
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
import Ember from 'ember';
|
import Controller from '@ember/controller';
|
||||||
|
import { computed } from '@ember/object';
|
||||||
import CollectionValidations from 'ccdb-web/validations/collection';
|
import CollectionValidations from 'ccdb-web/validations/collection';
|
||||||
import CollectionSpeciesValidations from 'ccdb-web/validations/collection-species';
|
import CollectionSpeciesValidations from 'ccdb-web/validations/collection-species';
|
||||||
import CollectionMeasurementValidations from 'ccdb-web/validations/collection-measurement';
|
import CollectionMeasurementValidations from 'ccdb-web/validations/collection-measurement';
|
||||||
import DatasheetValidations from 'ccdb-web/validations/datasheet';
|
import DatasheetValidations from 'ccdb-web/validations/datasheet';
|
||||||
import ValidationMixin from 'ccdb-web/mixins/validation';
|
import ValidationMixin from 'ccdb-web/mixins/validation';
|
||||||
|
|
||||||
const { Controller, computed } = Ember;
|
|
||||||
|
|
||||||
export default Controller.extend(ValidationMixin, {
|
export default Controller.extend(ValidationMixin, {
|
||||||
CollectionValidations,
|
CollectionValidations,
|
||||||
CollectionSpeciesValidations,
|
CollectionSpeciesValidations,
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
import Ember from 'ember';
|
import Controller from '@ember/controller';
|
||||||
|
import { computed } from '@ember/object';
|
||||||
import CollectionValidations from 'ccdb-web/validations/collection';
|
import CollectionValidations from 'ccdb-web/validations/collection';
|
||||||
import CollectionSpeciesValidations from 'ccdb-web/validations/collection-species';
|
import CollectionSpeciesValidations from 'ccdb-web/validations/collection-species';
|
||||||
import CollectionMeasurementValidations from 'ccdb-web/validations/collection-measurement';
|
import CollectionMeasurementValidations from 'ccdb-web/validations/collection-measurement';
|
||||||
import DatasheetValidations from 'ccdb-web/validations/datasheet';
|
import DatasheetValidations from 'ccdb-web/validations/datasheet';
|
||||||
import ValidationMixin from 'ccdb-web/mixins/validation';
|
import ValidationMixin from 'ccdb-web/mixins/validation';
|
||||||
|
|
||||||
const { Controller, computed } = Ember;
|
|
||||||
|
|
||||||
export default Controller.extend(ValidationMixin, {
|
export default Controller.extend(ValidationMixin, {
|
||||||
CollectionValidations,
|
CollectionValidations,
|
||||||
CollectionSpeciesValidations,
|
CollectionSpeciesValidations,
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import Ember from 'ember';
|
import Controller from '@ember/controller';
|
||||||
|
|
||||||
const { Controller } = Ember;
|
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
actions: {
|
actions: {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import Ember from 'ember';
|
import Controller from '@ember/controller';
|
||||||
|
import { set, get, computed } from '@ember/object';
|
||||||
const { Controller, computed, get, set } = Ember;
|
|
||||||
|
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import Ember from 'ember';
|
import Controller from '@ember/controller';
|
||||||
|
import { inject as service } from '@ember/service';
|
||||||
const { Controller, inject: { service } } = Ember;
|
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
session: service(),
|
session: service(),
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
<body>
|
<body>
|
||||||
{{content-for "body"}}
|
{{content-for "body"}}
|
||||||
|
|
||||||
<script src="{{rootURL}}assets/vendor.js"></script>
|
<script integrity="" src="{{rootURL}}assets/vendor.js"></script>
|
||||||
<script src="{{rootURL}}assets/ccdb-web.js"></script>
|
<script integrity="" src="{{rootURL}}assets/ccdb-web.js"></script>
|
||||||
|
|
||||||
{{content-for "body-footer"}}
|
{{content-for "body-footer"}}
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import Ember from 'ember';
|
import Mixin from '@ember/object/mixin';
|
||||||
|
import { isArray } from '@ember/array';
|
||||||
const { Mixin, isArray } = Ember;
|
|
||||||
const { keys } = Object;
|
const { keys } = Object;
|
||||||
|
|
||||||
// Portions borrowed from https://github.com/funtusov/ember-cli-form-data
|
// Portions borrowed from https://github.com/funtusov/ember-cli-form-data
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import Ember from 'ember';
|
import Mixin from '@ember/object/mixin';
|
||||||
|
import { get } from '@ember/object';
|
||||||
const { Mixin, get, RSVP } = Ember;
|
import RSVP from 'rsvp';
|
||||||
const { keys } = Object;
|
const { keys } = Object;
|
||||||
const { isArray } = Array;
|
const { isArray } = Array;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import Ember from 'ember';
|
import { mapBy } from '@ember/object/computed';
|
||||||
|
import { computed } from '@ember/object';
|
||||||
import DS from 'ember-data';
|
import DS from 'ember-data';
|
||||||
|
|
||||||
const { computed } = Ember;
|
|
||||||
const { Model, attr, belongsTo, hasMany } = DS;
|
const { Model, attr, belongsTo, hasMany } = DS;
|
||||||
|
|
||||||
export default Model.extend({
|
export default Model.extend({
|
||||||
|
@ -24,11 +24,11 @@ export default Model.extend({
|
||||||
envMeasurements: hasMany('collection-measurement'),
|
envMeasurements: hasMany('collection-measurement'),
|
||||||
|
|
||||||
// computed
|
// computed
|
||||||
species: computed.mapBy('collectionSpecies', 'species'),
|
species: mapBy('collectionSpecies', 'species'),
|
||||||
|
|
||||||
speciesNames: computed.mapBy('species', 'commonName'),
|
speciesNames: mapBy('species', 'commonName'),
|
||||||
|
|
||||||
counts: computed.mapBy('collectionSpecies', 'count'),
|
counts: mapBy('collectionSpecies', 'count'),
|
||||||
|
|
||||||
speciesAndCounts: computed('speciesNames', 'counts', function() {
|
speciesAndCounts: computed('speciesNames', 'counts', function() {
|
||||||
const speciesNames = this.get('speciesNames');
|
const speciesNames = this.get('speciesNames');
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import Ember from 'ember';
|
import EmberRouter from '@ember/routing/router';
|
||||||
import config from './config/environment';
|
import config from './config/environment';
|
||||||
|
|
||||||
const Router = Ember.Router.extend({
|
const Router = EmberRouter.extend({
|
||||||
location: config.locationType,
|
location: config.locationType,
|
||||||
rootURL: config.rootURL
|
rootURL: config.rootURL
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import Ember from 'ember';
|
import Route from '@ember/routing/route';
|
||||||
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin';
|
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin';
|
||||||
|
|
||||||
const { Route } = Ember;
|
|
||||||
|
|
||||||
export default Route.extend(ApplicationRouteMixin, {});
|
export default Route.extend(ApplicationRouteMixin, {});
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import Ember from 'ember';
|
import Route from '@ember/routing/route';
|
||||||
|
import RSVP from 'rsvp';
|
||||||
const { Route, RSVP } = Ember;
|
|
||||||
|
|
||||||
export default Route.extend({
|
export default Route.extend({
|
||||||
model() {
|
model() {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import Ember from 'ember';
|
import Route from '@ember/routing/route';
|
||||||
|
import RSVP from 'rsvp';
|
||||||
const { Route, RSVP } = Ember;
|
|
||||||
|
|
||||||
export default Route.extend({
|
export default Route.extend({
|
||||||
model(params) {
|
model(params) {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import Ember from 'ember';
|
import Route from '@ember/routing/route';
|
||||||
|
import RSVP from 'rsvp';
|
||||||
const { Route, RSVP } = Ember;
|
|
||||||
|
|
||||||
export default Route.extend({
|
export default Route.extend({
|
||||||
model() {
|
model() {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import Ember from 'ember';
|
import Route from '@ember/routing/route';
|
||||||
|
import RSVP from 'rsvp';
|
||||||
const { Route, RSVP } = Ember;
|
|
||||||
|
|
||||||
export default Route.extend({
|
export default Route.extend({
|
||||||
queryParams: {
|
queryParams: {
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
import Ember from 'ember';
|
import Route from '@ember/routing/route';
|
||||||
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
|
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
|
||||||
|
|
||||||
const { Route } = Ember;
|
|
||||||
|
|
||||||
export default Route.extend(AuthenticatedRouteMixin, {
|
export default Route.extend(AuthenticatedRouteMixin, {
|
||||||
afterModel() {
|
afterModel() {
|
||||||
this.transitionTo('collections');
|
this.transitionTo('collections');
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import Ember from 'ember';
|
import Route from '@ember/routing/route';
|
||||||
import UnauthenticatedRouteMixin from 'ember-simple-auth/mixins/unauthenticated-route-mixin';
|
import UnauthenticatedRouteMixin from 'ember-simple-auth/mixins/unauthenticated-route-mixin';
|
||||||
|
|
||||||
const { Route } = Ember;
|
|
||||||
|
|
||||||
export default Route.extend(UnauthenticatedRouteMixin, {});
|
export default Route.extend(UnauthenticatedRouteMixin, {});
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import Ember from 'ember';
|
import Route from '@ember/routing/route';
|
||||||
|
import { inject as service } from '@ember/service';
|
||||||
const { Route, inject: { service }} = Ember;
|
|
||||||
|
|
||||||
export default Route.extend({
|
export default Route.extend({
|
||||||
session: service('session'),
|
session: service('session'),
|
||||||
|
|
|
@ -1,10 +1,16 @@
|
||||||
import Ember from 'ember';
|
import { capitalize } from '@ember/string';
|
||||||
import DS from 'ember-data';
|
import DS from 'ember-data';
|
||||||
|
|
||||||
const { JSONAPISerializer } = DS;
|
const { JSONAPISerializer } = DS;
|
||||||
|
|
||||||
export default JSONAPISerializer.extend({
|
export default JSONAPISerializer.extend({
|
||||||
payloadTypeFromModelName(modelName) {
|
payloadTypeFromModelName(modelName) {
|
||||||
return modelName.split('-').map(key => Ember.String.capitalize(key)).join('');
|
return modelName.split('-').map(key => capitalize(key)).join('');
|
||||||
}
|
},
|
||||||
|
|
||||||
|
normalizeArrayResponse(store, primaryModelClass, payload, id, requestType) {
|
||||||
|
let normalizedDocument = this._super(store, primaryModelClass, payload, id, requestType);
|
||||||
|
normalizedDocument.meta.links = normalizedDocument.links;
|
||||||
|
return normalizedDocument;
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
18
package.json
18
package.json
|
@ -19,23 +19,23 @@
|
||||||
"ember-ajax": "^3.0.0",
|
"ember-ajax": "^3.0.0",
|
||||||
"ember-changeset": "1.3.0",
|
"ember-changeset": "1.3.0",
|
||||||
"ember-changeset-validations": "1.2.8",
|
"ember-changeset-validations": "1.2.8",
|
||||||
"ember-cli": "~2.14.0",
|
"ember-cli": "^2.16.2",
|
||||||
"ember-cli-app-version": "^3.0.0",
|
"ember-cli-app-version": "^3.0.0",
|
||||||
"ember-cli-babel": "^6.3.0",
|
"ember-cli-babel": "^6.6.0",
|
||||||
"ember-cli-code-coverage": "^0.4.1",
|
"ember-cli-code-coverage": "^0.4.1",
|
||||||
"ember-cli-dependency-checker": "^1.3.0",
|
"ember-cli-dependency-checker": "^2.0.0",
|
||||||
"ember-cli-eslint": "^3.0.0",
|
"ember-cli-eslint": "^4.0.0",
|
||||||
"ember-cli-flash": "1.4.3",
|
"ember-cli-flash": "^1.4.3",
|
||||||
"ember-cli-htmlbars": "^2.0.1",
|
"ember-cli-htmlbars": "^2.0.1",
|
||||||
"ember-cli-htmlbars-inline-precompile": "^0.4.3",
|
"ember-cli-htmlbars-inline-precompile": "^1.0.0",
|
||||||
"ember-cli-inject-live-reload": "^1.4.1",
|
"ember-cli-inject-live-reload": "^1.4.1",
|
||||||
"ember-cli-moment-shim": "^3.5.0",
|
"ember-cli-moment-shim": "^3.5.0",
|
||||||
"ember-cli-qunit": "^4.0.0",
|
"ember-cli-qunit": "^4.0.0",
|
||||||
"ember-cli-shims": "^1.1.0",
|
"ember-cli-shims": "^1.1.0",
|
||||||
"ember-cli-sri": "^2.1.0",
|
"ember-cli-sri": "^2.1.0",
|
||||||
"ember-cli-uglify": "^1.2.0",
|
"ember-cli-uglify": "^2.0.0",
|
||||||
"ember-composable-helpers": "^2.0.3",
|
"ember-composable-helpers": "^2.0.3",
|
||||||
"ember-data": "~2.14.3",
|
"ember-data": "~2.16.2",
|
||||||
"ember-export-application-global": "^2.0.0",
|
"ember-export-application-global": "^2.0.0",
|
||||||
"ember-inflector": "^2.0.1",
|
"ember-inflector": "^2.0.1",
|
||||||
"ember-light-table": "^1.10.0",
|
"ember-light-table": "^1.10.0",
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
"ember-responsive": "^2.0.4",
|
"ember-responsive": "^2.0.4",
|
||||||
"ember-simple-auth": "1.4.0",
|
"ember-simple-auth": "1.4.0",
|
||||||
"ember-sinon": "^1.0.0",
|
"ember-sinon": "^1.0.0",
|
||||||
"ember-source": "~2.14.0",
|
"ember-source": "~2.16.0",
|
||||||
"loader.js": "^4.2.3"
|
"loader.js": "^4.2.3"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
16
testem.js
16
testem.js
|
@ -3,10 +3,20 @@ module.exports = {
|
||||||
test_page: 'tests/index.html?hidepassed',
|
test_page: 'tests/index.html?hidepassed',
|
||||||
disable_watching: true,
|
disable_watching: true,
|
||||||
launch_in_ci: [
|
launch_in_ci: [
|
||||||
'PhantomJS'
|
'Chrome'
|
||||||
],
|
],
|
||||||
launch_in_dev: [
|
launch_in_dev: [
|
||||||
'PhantomJS',
|
|
||||||
'Chrome'
|
'Chrome'
|
||||||
]
|
],
|
||||||
|
browser_args: {
|
||||||
|
Chrome: {
|
||||||
|
mode: 'ci',
|
||||||
|
args: [
|
||||||
|
'--disable-gpu',
|
||||||
|
'--headless',
|
||||||
|
'--remote-debugging-port=9222',
|
||||||
|
'--window-size=1440,900'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import Ember from 'ember';
|
import { run } from '@ember/runloop';
|
||||||
|
|
||||||
export default function destroyApp(application) {
|
export default function destroyApp(application) {
|
||||||
Ember.run(application, 'destroy');
|
run(application, 'destroy');
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
import Ember from 'ember';
|
|
||||||
import FlashObject from 'ember-cli-flash/flash/object';
|
import FlashObject from 'ember-cli-flash/flash/object';
|
||||||
|
|
||||||
const { K } = Ember;
|
FlashObject.reopen({ init() {} });
|
||||||
|
|
||||||
FlashObject.reopen({ init: K });
|
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
import { module } from 'qunit';
|
import { module } from 'qunit';
|
||||||
import Ember from 'ember';
|
import { resolve } from 'rsvp';
|
||||||
import startApp from '../helpers/start-app';
|
import startApp from '../helpers/start-app';
|
||||||
import destroyApp from '../helpers/destroy-app';
|
import destroyApp from '../helpers/destroy-app';
|
||||||
|
|
||||||
const { RSVP: { resolve } } = Ember;
|
|
||||||
|
|
||||||
export default function(name, options = {}) {
|
export default function(name, options = {}) {
|
||||||
module(name, {
|
module(name, {
|
||||||
beforeEach() {
|
beforeEach() {
|
||||||
|
|
|
@ -1,17 +1,16 @@
|
||||||
import Ember from 'ember';
|
import { registerAsyncHelper } from '@ember/test';
|
||||||
|
import { A } from '@ember/array';
|
||||||
|
import { computed } from '@ember/object';
|
||||||
|
import { classify } from '@ember/string';
|
||||||
|
import { getOwner } from '@ember/application';
|
||||||
import MediaService from 'ember-responsive/media';
|
import MediaService from 'ember-responsive/media';
|
||||||
|
|
||||||
const {
|
|
||||||
getOwner
|
|
||||||
} = Ember;
|
|
||||||
const { classify } = Ember.String;
|
|
||||||
|
|
||||||
MediaService.reopen({
|
MediaService.reopen({
|
||||||
// Change this if you want a different default breakpoint in tests.
|
// Change this if you want a different default breakpoint in tests.
|
||||||
_defaultBreakpoint: 'desktop',
|
_defaultBreakpoint: 'desktop',
|
||||||
|
|
||||||
_breakpointArr: Ember.computed('breakpoints', function() {
|
_breakpointArr: computed('breakpoints', function() {
|
||||||
return Object.keys(this.get('breakpoints')) || Ember.A([]);
|
return Object.keys(this.get('breakpoints')) || A([]);
|
||||||
}),
|
}),
|
||||||
|
|
||||||
_forceSetBreakpoint(breakpoint) {
|
_forceSetBreakpoint(breakpoint) {
|
||||||
|
@ -45,7 +44,7 @@ MediaService.reopen({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default Ember.Test.registerAsyncHelper('setBreakpoint', function(app, breakpoint) {
|
export default registerAsyncHelper('setBreakpoint', function(app, breakpoint) {
|
||||||
// this should use getOwner once that's supported
|
// this should use getOwner once that's supported
|
||||||
const mediaService = app.__deprecatedInstance__.lookup('service:media');
|
const mediaService = app.__deprecatedInstance__.lookup('service:media');
|
||||||
mediaService._forceSetBreakpoint(breakpoint);
|
mediaService._forceSetBreakpoint(breakpoint);
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
import Ember from 'ember';
|
|
||||||
import Application from '../../app';
|
import Application from '../../app';
|
||||||
import config from '../../config/environment';
|
import config from '../../config/environment';
|
||||||
|
import { merge } from '@ember/polyfills';
|
||||||
|
import { run } from '@ember/runloop';
|
||||||
|
|
||||||
export default function startApp(attrs) {
|
export default function startApp(attrs) {
|
||||||
let attributes = Ember.merge({}, config.APP);
|
let attributes = merge({}, config.APP);
|
||||||
attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
|
attributes = merge(attributes, attrs); // use defaults, but you can override;
|
||||||
|
|
||||||
return Ember.run(() => {
|
return run(() => {
|
||||||
let application = Application.create(attributes);
|
let application = Application.create(attributes);
|
||||||
application.setupForTesting();
|
application.setupForTesting();
|
||||||
application.injectTestHelpers();
|
application.injectTestHelpers();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
import $ from 'jquery';
|
||||||
import { moduleFor, test } from 'ember-qunit';
|
import { moduleFor, test } from 'ember-qunit';
|
||||||
import sinon from 'sinon';
|
import sinon from 'sinon';
|
||||||
import Ember from 'ember';
|
|
||||||
|
|
||||||
moduleFor('authenticator:application', 'Unit | application', {
|
moduleFor('authenticator:application', 'Unit | application', {
|
||||||
unit: true,
|
unit: true,
|
||||||
|
@ -35,28 +35,28 @@ test('`invalidate` should invalidate the session', function(assert) {
|
||||||
|
|
||||||
test('`makeRequest` should make a request', function(assert) {
|
test('`makeRequest` should make a request', function(assert) {
|
||||||
assert.expect(2);
|
assert.expect(2);
|
||||||
const stub = sinon.stub(Ember.$, 'ajax');
|
const stub = sinon.stub($, 'ajax');
|
||||||
stub.resolves(42);
|
stub.resolves(42);
|
||||||
const authenticator = this.subject();
|
const authenticator = this.subject();
|
||||||
authenticator.set('serverTokenEndpoint', 'foo')
|
authenticator.set('serverTokenEndpoint', 'foo')
|
||||||
const promise = authenticator.makeRequest({bar: 'baz'}).then((d) => {
|
const promise = authenticator.makeRequest({bar: 'baz'}).then((d) => {
|
||||||
assert.equal(d, 42);
|
assert.equal(d, 42);
|
||||||
});
|
});
|
||||||
assert.ok(Ember.$.ajax.calledWithMatch({url: 'foo', data: {bar: 'baz'}}));
|
assert.ok($.ajax.calledWithMatch({url: 'foo', data: {bar: 'baz'}}));
|
||||||
Ember.$.ajax.restore();
|
$.ajax.restore();
|
||||||
return promise;
|
return promise;
|
||||||
});
|
});
|
||||||
|
|
||||||
test('authenticate should craft a nice payload', function(assert) {
|
test('authenticate should craft a nice payload', function(assert) {
|
||||||
assert.expect(2);
|
assert.expect(2);
|
||||||
const stub = sinon.stub(Ember.$, 'ajax');
|
const stub = sinon.stub($, 'ajax');
|
||||||
stub.resolves(42);
|
stub.resolves(42);
|
||||||
const authenticator = this.subject();
|
const authenticator = this.subject();
|
||||||
authenticator.set('serverTokenEndpoint', 'foo')
|
authenticator.set('serverTokenEndpoint', 'foo')
|
||||||
const promise = authenticator.authenticate('myusername', 'mypassword').then((d) => {
|
const promise = authenticator.authenticate('myusername', 'mypassword').then((d) => {
|
||||||
assert.equal(d, 42);
|
assert.equal(d, 42);
|
||||||
});
|
});
|
||||||
assert.ok(Ember.$.ajax.calledWithMatch({url: 'foo', data: {username: 'myusername', password: 'mypassword'}}));
|
assert.ok($.ajax.calledWithMatch({url: 'foo', data: {username: 'myusername', password: 'mypassword'}}));
|
||||||
Ember.$.ajax.restore();
|
$.ajax.restore();
|
||||||
return promise;
|
return promise;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue