Update Ember to 3.1

This commit is contained in:
2018-04-16 13:42:08 +02:00
parent e009caaf25
commit b09f19f399
156 changed files with 10149 additions and 16972 deletions
+9 -9
View File
@@ -1,12 +1,12 @@
import { moduleFor, test } from 'ember-qunit';
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
moduleFor('controller:application', 'Unit | Controller | application', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
module('Unit | Controller | application', function(hooks) {
setupTest(hooks);
// Replace this with your real tests.
test('it exists', function(assert) {
let controller = this.subject();
assert.ok(controller);
// Replace this with your real tests.
test('it exists', function(assert) {
let controller = this.owner.lookup('controller:application');
assert.ok(controller);
});
});
+23 -27
View File
@@ -1,33 +1,29 @@
import Ember from 'ember';
import { isEmpty, isPresent } from '@ember/utils';
import Contributor from 'kredits-web/models/contributor';
import { moduleFor, test } from 'ember-qunit';
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
const {
isPresent,
isEmpty
} = Ember;
module('Unit | Controller | index', function(hooks) {
setupTest(hooks);
moduleFor('controller:index', 'Unit | Controller | index', {
needs: ['service:kredits']
});
let addFixtures = function(controller) {
[
{ github_username: "neo", github_uid: "318", balance: 10000 },
{ github_username: "morpheus", github_uid: "843", balance: 15000 },
{ github_username: "trinity", github_uid: "123", balance: 5000 },
{ github_username: "mouse", github_uid: "696", balance: 0 }
].forEach(fixture => {
controller.get('kredits.contributors').push(Contributor.create(fixture));
});
};
let addFixtures = function(controller) {
[
{ github_username: "neo", github_uid: "318", balance: 10000 },
{ github_username: "morpheus", github_uid: "843", balance: 15000 },
{ github_username: "trinity", github_uid: "123", balance: 5000 },
{ github_username: "mouse", github_uid: "696", balance: 0 }
].forEach(fixture => {
controller.get('kredits.contributors').push(Contributor.create(fixture));
test('doesn\'t contain people with 0 balance', function(assert) {
let controller = this.owner.lookup('controller:index');
addFixtures(controller);
let contributorsSorted = controller.get('contributorsSorted');
assert.ok(isPresent(contributorsSorted.findBy('github_username', 'neo')));
assert.ok(isEmpty(contributorsSorted.findBy('github_username', 'mouse')));
});
};
test('doesn\'t contain people with 0 balance', function(assert) {
let controller = this.subject();
addFixtures(controller);
let contributorsSorted = controller.get('contributorsSorted');
assert.ok(isPresent(contributorsSorted.findBy('github_username', 'neo')));
assert.ok(isEmpty(contributorsSorted.findBy('github_username', 'mouse')));
});
+9 -9
View File
@@ -1,12 +1,12 @@
import { moduleFor, test } from 'ember-qunit';
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
moduleFor('controller:proposals/new', 'Unit | Controller | proposals/new', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
module('Unit | Controller | proposals/new', function(hooks) {
setupTest(hooks);
// Replace this with your real tests.
test('it exists', function(assert) {
let controller = this.subject();
assert.ok(controller);
// Replace this with your real tests.
test('it exists', function(assert) {
let controller = this.owner.lookup('controller:proposals/new');
assert.ok(controller);
});
});