Fix tests, remove obsolete initializers
This commit is contained in:
@@ -1,20 +0,0 @@
|
|||||||
/**
|
|
||||||
* This pauses the app's boot process until the window load event is fired.
|
|
||||||
* It allows the user provided Web3 instance (e.g. Metamask, Mist Browser)
|
|
||||||
* to be inserted before we try to use it.
|
|
||||||
*/
|
|
||||||
export default {
|
|
||||||
name: 'defer-loading',
|
|
||||||
initialize: function(application) {
|
|
||||||
// Load event already fired, so web3 should be loaded if available
|
|
||||||
if (window.windowLoadComplete) { return true; }
|
|
||||||
|
|
||||||
// Pause app loading
|
|
||||||
application.deferReadiness();
|
|
||||||
|
|
||||||
window.addEventListener('load', function() {
|
|
||||||
// Continue app loading
|
|
||||||
application.advanceReadiness();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
import Contributor from 'kredits-web/models/contributor';
|
|
||||||
import Proposal from 'kredits-web/models/proposal';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'register-models',
|
|
||||||
initialize: function(app) {
|
|
||||||
app.register('model:contributor', Contributor, { singleton: false });
|
|
||||||
app.register('model:proposal', Proposal, { singleton: false });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,13 +1,12 @@
|
|||||||
import { module, test } from 'qunit';
|
import { module, test } from 'qunit';
|
||||||
import { setupTest } from 'ember-qunit';
|
import { setupTest } from 'ember-qunit';
|
||||||
|
import Contributor from 'kredits-web/models/contributor';
|
||||||
import { run } from '@ember/runloop';
|
|
||||||
|
|
||||||
module('Unit | Model | contributor', function(hooks) {
|
module('Unit | Model | contributor', function(hooks) {
|
||||||
setupTest(hooks);
|
setupTest(hooks);
|
||||||
|
|
||||||
test('#avatarURL() returns correct URL', function(assert) {
|
test('#avatarURL() returns correct URL', function(assert) {
|
||||||
let model = run(() => this.owner.lookup('service:store').createRecord('contributor'));
|
let model = Contributor.create();
|
||||||
model.set('github_uid', '318');
|
model.set('github_uid', '318');
|
||||||
|
|
||||||
assert.equal(model.get('avatarURL'), 'https://avatars2.githubusercontent.com/u/318?v=3&s=128');
|
assert.equal(model.get('avatarURL'), 'https://avatars2.githubusercontent.com/u/318?v=3&s=128');
|
||||||
|
|||||||
Reference in New Issue
Block a user