mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 05:42:32 +03:00
ea9c8c03fe
refs https://github.com/TryGhost/Ghost/pull/15550 Pulled out of the rolled up node+ember-js+ember-template rollup linter update PR as it required fairly extensive changes. - bumped package - renamed `no-down-event-binding` to `no-pointer-down-event-binding` - disabled `no-pointer-down-event-binding` rule - disabled `no-triple-curlies` rule - ran `yarn lint:hbs --fix` - updated integration tests to match Octane syntax - fixed various one-off errors - updated .lint-todo
38 lines
1.2 KiB
JavaScript
38 lines
1.2 KiB
JavaScript
import Service from '@ember/service';
|
|
import hbs from 'htmlbars-inline-precompile';
|
|
import {describe, it} from 'mocha';
|
|
import {A as emberA} from '@ember/array';
|
|
import {expect} from 'chai';
|
|
import {find, render, settled} from '@ember/test-helpers';
|
|
import {setupRenderingTest} from 'ember-mocha';
|
|
|
|
let notificationsStub = Service.extend({
|
|
notifications: emberA()
|
|
});
|
|
|
|
describe('Integration: Component: gh-notifications', function () {
|
|
setupRenderingTest();
|
|
|
|
beforeEach(function () {
|
|
this.owner.register('service:notifications', notificationsStub);
|
|
let notifications = this.owner.lookup('service:notifications');
|
|
|
|
notifications.set('notifications', [
|
|
{message: 'First', type: 'error'},
|
|
{message: 'Second', type: 'warn'}
|
|
]);
|
|
});
|
|
|
|
it('renders', async function () {
|
|
await render(hbs`<GhNotifications />`);
|
|
expect(find('.gh-notifications')).to.exist;
|
|
|
|
expect(find('.gh-notifications').children.length).to.equal(2);
|
|
|
|
let notifications = this.owner.lookup('service:notifications');
|
|
notifications.set('notifications', emberA());
|
|
await settled();
|
|
expect(find('.gh-notifications').children.length).to.equal(0);
|
|
});
|
|
});
|