mirror of
https://github.com/datahub-project/datahub.git
synced 2025-10-27 17:02:03 +00:00
24 lines
811 B
JavaScript
24 lines
811 B
JavaScript
|
|
import { moduleFor, test } from 'ember-qunit';
|
||
|
|
|
||
|
|
moduleFor('service:banners', 'Unit | Service | banners', {});
|
||
|
|
|
||
|
|
test('it exists', function(assert) {
|
||
|
|
const service = this.subject();
|
||
|
|
assert.ok(service, 'Existence is a good start');
|
||
|
|
});
|
||
|
|
|
||
|
|
test('it operates correctly', function(assert) {
|
||
|
|
const service = this.subject();
|
||
|
|
const message = 'Ash Ketchum from Pallet Town';
|
||
|
|
|
||
|
|
service.addBanner('Ash Ketchum from Pallet Town', 'info');
|
||
|
|
|
||
|
|
assert.equal(service.banners.length, 1, 'Created a banner');
|
||
|
|
assert.equal(service.banners[0].content, message, 'Creates a banner with the right message');
|
||
|
|
assert.equal(service.banners[0].isDismissable, true, 'Creates a banner with the right dismiss');
|
||
|
|
|
||
|
|
service.dequeue().then(() => {
|
||
|
|
assert.equal(service.banners.length, 0, 'Removes a banner correctly');
|
||
|
|
});
|
||
|
|
});
|