Vendored
+1
-1
@@ -18,7 +18,7 @@ const data = [
|
||||
|
||||
data.forEach(attrs => {
|
||||
const c = Model.create(processContributionData(attrs));
|
||||
c.set('contributor', contributors.findBy('id', attrs.contributorId.toString()));
|
||||
c.set('contributor', contributors.findBy('id', attrs.contributorId));
|
||||
items.push(c);
|
||||
});
|
||||
|
||||
|
||||
Vendored
+3
-3
@@ -4,9 +4,9 @@ import processContributorData from 'kredits-web/utils/process-contributor-data';
|
||||
const contributors = [];
|
||||
|
||||
const data = [
|
||||
{ id: '1', name: 'Bumi', totalKreditsEarned: 11500, github_uid: 318 },
|
||||
{ id: '2', name: 'Râu Cao', totalKreditsEarned: 3000, github_uid: 842 },
|
||||
{ id: '3', name: 'Manuel', totalKreditsEarned: 0, github_uid: 54812 }
|
||||
{ id: 1, name: 'Bumi', totalKreditsEarned: 11500, github_uid: 318 },
|
||||
{ id: 2, name: 'Râu Cao', totalKreditsEarned: 3000, github_uid: 842 },
|
||||
{ id: 3, name: 'Manuel', totalKreditsEarned: 0, github_uid: 54812 }
|
||||
];
|
||||
|
||||
data.forEach(attrs => {
|
||||
|
||||
@@ -16,8 +16,10 @@ module('Integration | Component | contribution-list', function(hooks) {
|
||||
});
|
||||
|
||||
test('it renders filtered contributions', async function(assert) {
|
||||
let service = this.owner.lookup('service:kredits');
|
||||
service.set('contributors', contributors);
|
||||
let kredits = this.owner.lookup('service:kredits');
|
||||
kredits.set('contributors', contributors);
|
||||
|
||||
debugger;
|
||||
|
||||
this.set('fixtures', contributions);
|
||||
await render(hbs`{{contribution-list contributions=fixtures showQuickFilter=true}}`);
|
||||
|
||||
@@ -8,14 +8,14 @@ module('Integration | Component | user-avatar', function(hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function(assert) {
|
||||
this.set('bumi', contributors.findBy('id', '1'));
|
||||
this.set('bumi', contributors.findBy('id', 1));
|
||||
await render(hbs`{{user-avatar contributor=bumi}}`);
|
||||
|
||||
assert.dom(this.element).hasText('');
|
||||
});
|
||||
|
||||
test('default image source URL', async function(assert) {
|
||||
this.set('bumi', contributors.findBy('id', '1'));
|
||||
this.set('bumi', contributors.findBy('id', 1));
|
||||
await render(hbs`{{user-avatar contributor=bumi}}`);
|
||||
|
||||
assert.equal(this.element.querySelector('img').src,
|
||||
@@ -23,7 +23,7 @@ module('Integration | Component | user-avatar', function(hooks) {
|
||||
});
|
||||
|
||||
test('size-specific image source URLs', async function(assert) {
|
||||
this.set('bumi', contributors.findBy('id', '1'));
|
||||
this.set('bumi', contributors.findBy('id', 1));
|
||||
this.set('size', 'medium');
|
||||
|
||||
await render(hbs`{{user-avatar contributor=bumi size=size}}`);
|
||||
|
||||
@@ -8,7 +8,7 @@ module('Unit | Utility | process-contributor-data', function() {
|
||||
|
||||
test('formats the data correctly', function(assert) {
|
||||
// TODO use integers everywhere for IDs
|
||||
assert.ok(typeof result.id === 'string');
|
||||
assert.ok(typeof result.id === 'number');
|
||||
assert.ok(typeof result.balance === 'number');
|
||||
assert.ok(typeof result.totalKreditsEarned === 'number');
|
||||
assert.ok(typeof result.contributionsCount === 'number');
|
||||
|
||||
Reference in New Issue
Block a user