2f4f6db133
no issue - add ember-suave dependency - upgrade grunt-jscs dependency - add a new .jscsrc for the client's tests directory that extends from client's base .jscsrc - separate client tests in Gruntfile jscs task so they pick up the test's .jscsrc - standardize es6 usage across client
34 lines
937 B
JavaScript
34 lines
937 B
JavaScript
/* jshint expr:true */
|
|
import { expect } from 'chai';
|
|
import {
|
|
describeComponent,
|
|
it
|
|
}
|
|
from 'ember-mocha';
|
|
import sinon from 'sinon';
|
|
|
|
describeComponent(
|
|
'gh-alert',
|
|
'Unit: Component: gh-alert',
|
|
{
|
|
unit: true
|
|
// specify the other units that are required for this test
|
|
// needs: ['component:foo', 'helper:bar']
|
|
},
|
|
function () {
|
|
it('closes notification through notifications service', function () {
|
|
let component = this.subject();
|
|
let notifications = {};
|
|
let notification = {message: 'Test close', type: 'success'};
|
|
|
|
notifications.closeNotification = sinon.spy();
|
|
component.set('notifications', notifications);
|
|
component.set('message', notification);
|
|
|
|
this.$().find('button').click();
|
|
|
|
expect(notifications.closeNotification.calledWith(notification)).to.be.true;
|
|
});
|
|
}
|
|
);
|