52 lines
1.5 KiB
Plaintext
52 lines
1.5 KiB
Plaintext
import { module, test } from 'qunit';
|
|
import { setupRenderingTest } from 'dashtab/tests/helpers';
|
|
import { render } from '@ember/test-helpers';
|
|
import SiteLinksGroup from 'dashtab/components/site-links/group';
|
|
|
|
module('Integration | Component | site-links/group', function (hooks) {
|
|
setupRenderingTest(hooks);
|
|
|
|
test('it renders an item per site without a visible label', async function (assert) {
|
|
this.set('items', [
|
|
{
|
|
id: 'discourse-abc',
|
|
label: 'forum.example.com',
|
|
href: 'https://forum.example.com',
|
|
status: 'ready',
|
|
unreadCount: 2,
|
|
},
|
|
{
|
|
id: 'discourse-def',
|
|
label: 'meta.example.com',
|
|
href: 'https://meta.example.com',
|
|
status: 'ready',
|
|
unreadCount: 0,
|
|
},
|
|
]);
|
|
|
|
await render(
|
|
<template>
|
|
<SiteLinksGroup @id="discourse" @items={{this.items}} />
|
|
</template>
|
|
);
|
|
|
|
assert.dom('[data-group="discourse"]').exists();
|
|
assert.dom('a').exists({ count: 2 });
|
|
assert.dom('[data-group="discourse"]').doesNotContainText('Discourse');
|
|
assert.dom('[data-group="discourse"]').doesNotContainText('forum');
|
|
});
|
|
|
|
test('it renders nothing when there are no items', async function (assert) {
|
|
this.set('items', []);
|
|
|
|
await render(
|
|
<template>
|
|
<SiteLinksGroup @id="discourse" @items={{this.items}} />
|
|
</template>
|
|
);
|
|
|
|
assert.dom('[data-group="discourse"]').exists();
|
|
assert.dom('a').doesNotExist();
|
|
});
|
|
});
|