mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-11 09:53:32 +03:00
a85f5fae35
no issue - fix lint errors in lib/gh-koenig - fix ghost:base eslint errors - update ember plugin refs, remove ember-suave plugin refs - remove old jshint refs - add `lint:js` script - switch to `eslint-plugin-ghost` extending `plugin:ghost/ember`
39 lines
1.4 KiB
JavaScript
39 lines
1.4 KiB
JavaScript
import hbs from 'htmlbars-inline-precompile';
|
|
import {describe, it} from 'mocha';
|
|
import {expect} from 'chai';
|
|
import {setupComponentTest} from 'ember-mocha';
|
|
|
|
describe('Integration: Component: gh-notification', function () {
|
|
setupComponentTest('gh-notification', {
|
|
integration: true
|
|
});
|
|
|
|
it('renders', function () {
|
|
this.set('message', {message: 'Test message', type: 'success'});
|
|
|
|
this.render(hbs`{{gh-notification message=message}}`);
|
|
|
|
expect(this.$('article.gh-notification')).to.have.length(1);
|
|
let $notification = this.$('.gh-notification');
|
|
|
|
expect($notification.hasClass('gh-notification-passive')).to.be.true;
|
|
expect($notification.text()).to.match(/Test message/);
|
|
});
|
|
|
|
it('maps message types to CSS classes', function () {
|
|
this.set('message', {message: 'Test message', type: 'success'});
|
|
|
|
this.render(hbs`{{gh-notification message=message}}`);
|
|
let $notification = this.$('.gh-notification');
|
|
|
|
this.set('message.type', 'success');
|
|
expect($notification.hasClass('gh-notification-green'), 'success class isn\'t green').to.be.true;
|
|
|
|
this.set('message.type', 'error');
|
|
expect($notification.hasClass('gh-notification-red'), 'success class isn\'t red').to.be.true;
|
|
|
|
this.set('message.type', 'warn');
|
|
expect($notification.hasClass('gh-notification-yellow'), 'success class isn\'t yellow').to.be.true;
|
|
});
|
|
});
|