mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 02:11:44 +03:00
e74e2e039e
no issue - switch `jscs` and `jshint` inline config to `eslint` config - fix eslint errors, predominantly in tests where the config now the main app config more closely
43 lines
1.2 KiB
JavaScript
43 lines
1.2 KiB
JavaScript
/* jshint expr:true */
|
|
import {expect} from 'chai';
|
|
import {
|
|
describeComponent,
|
|
it
|
|
} from 'ember-mocha';
|
|
import hbs from 'htmlbars-inline-precompile';
|
|
import Service from 'ember-service';
|
|
import {A as emberA} from 'ember-array/utils';
|
|
|
|
let notificationsStub = Service.extend({
|
|
notifications: emberA()
|
|
});
|
|
|
|
describeComponent(
|
|
'gh-notifications',
|
|
'Integration: Component: gh-notifications',
|
|
{
|
|
integration: true
|
|
},
|
|
function () {
|
|
beforeEach(function () {
|
|
this.register('service:notifications', notificationsStub);
|
|
this.inject.service('notifications', {as: 'notifications'});
|
|
|
|
this.set('notifications.notifications', [
|
|
{message: 'First', type: 'error'},
|
|
{message: 'Second', type: 'warn'}
|
|
]);
|
|
});
|
|
|
|
it('renders', function () {
|
|
this.render(hbs`{{gh-notifications}}`);
|
|
expect(this.$('.gh-notifications').length).to.equal(1);
|
|
|
|
expect(this.$('.gh-notifications').children().length).to.equal(2);
|
|
|
|
this.set('notifications.notifications', emberA());
|
|
expect(this.$('.gh-notifications').children().length).to.equal(0);
|
|
});
|
|
}
|
|
);
|