travis-web/tests/unit/components/user-avatar-test.js
2016-01-26 14:50:58 +01:00

22 lines
674 B
JavaScript

import { moduleForComponent, test } from 'ember-qunit';
import Ember from 'ember';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('user-avatar', 'UserAvatarComponent | Unit', {
});
test('it renders', function() {
var name = "Hello Test";
var url = "https://someurl.com/someimage.jpg";
var component = this.subject({url: url, name: name});
this.append();
ok(component.$().hasClass('avatar'), 'component should have right class');
equal(component.$('.pseudo-avatar').data('initials'), 'HT', 'initials should be correct');
equal(component.$('.real-avatar').attr('src'), 'https://someurl.com/someimage.jpg', 'avatar should be right');
});