import { module, test } from 'qunit'; import { setupRenderingTest } from 'admin/tests/helpers'; import { render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; module('Integration | Component | metadata-list/item', function (hooks) { setupRenderingTest(hooks); test('it renders horizontal (default) with icon, color and text', async function (assert) { assert.expect(3); await render(hbs` Sample text `); assert.dom('[data-test-icon="arrow-up"]').isVisible(); assert.dom('li.metadata-list-item').hasClass('hds-foreground-success'); assert.dom('li.metadata-list-item').hasText('Sample text'); }); test('it renders vertical with icon, color and text', async function (assert) { assert.expect(4); await render(hbs` Sample text 2 `); assert.dom('ul.metadata-list').hasClass('vertical'); assert.dom('[data-test-icon="arrow-down"]').isVisible(); assert.dom('li.metadata-list-item').hasClass('hds-foreground-action'); assert.dom('li.metadata-list-item').hasText('Sample text 2'); }); test('it renders no icon if @icon not provided', async function (assert) { assert.expect(2); await render(hbs` Sample text 3 `); assert.dom('.flight-icon').isNotVisible(); assert.dom('li.metadata-list-item').hasText('Sample text 3'); }); });