Ghost/ghost/admin/tests/integration/components/gh-notifications-test.js
Kevin Ansfield ea9c8c03fe
Update dependency ember-template-lint to v5.3.0 (#16062)
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
2023-01-04 09:39:32 +00:00

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);
});
});