refactor: 💡 remove uneeded rose cards component (#2243)
✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13321
This commit is contained in:
1 parent
37cbb74c76
commit
adc50a939f
4 files changed
-137
No files matched your search
@@ -1,66 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: MPL-2.0
|
||||
*/
|
||||
|
||||
import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'ember-qunit';
|
||||
import { render, find } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module('Integration | Component | rose/card/link', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
await render(hbs`<Rose::Card::Link />`);
|
||||
assert.ok(find('article'));
|
||||
assert.ok(find('.rose-card-link'));
|
||||
assert.ok(find('.rose-card-link-header'));
|
||||
assert.ok(find('.rose-card-link-body'));
|
||||
assert.ok(find('.rose-card-link-footer'));
|
||||
});
|
||||
|
||||
test('it renders with @title', async function (assert) {
|
||||
await render(hbs`<Rose::Card::Link @title="card title" />`);
|
||||
assert.strictEqual(find('a').title, 'card title');
|
||||
assert.strictEqual(
|
||||
find('.rose-card-link-title').textContent.trim(),
|
||||
'card title',
|
||||
);
|
||||
});
|
||||
|
||||
test('it renders with @description', async function (assert) {
|
||||
await render(hbs`<Rose::Card::Link @description="card description" />`);
|
||||
assert.strictEqual(
|
||||
find('.rose-card-link-body').textContent.trim(),
|
||||
'card description',
|
||||
);
|
||||
});
|
||||
|
||||
test('it renders with @id', async function (assert) {
|
||||
await render(hbs`<Rose::Card::Link @id="card_id" />`);
|
||||
assert.strictEqual(
|
||||
find('.rose-card-link-footer-id').textContent.trim(),
|
||||
'card_id',
|
||||
);
|
||||
});
|
||||
|
||||
test('it renders with @icon', async function (assert) {
|
||||
await render(
|
||||
hbs`<Rose::Card::Link @title="foo" @icon="flight-icons/svg/alert-circle-16" />`,
|
||||
);
|
||||
assert.ok(find('.rose-icon'));
|
||||
});
|
||||
|
||||
test('it renders with attributes', async function (assert) {
|
||||
await render(hbs`<Rose::Card::Link id="card" />`);
|
||||
assert.ok(find('#card'));
|
||||
});
|
||||
|
||||
test('it renders with content', async function (assert) {
|
||||
await render(hbs`<Rose::Card::Link>
|
||||
<button type="button" />
|
||||
</Rose::Card::Link>`);
|
||||
assert.ok(find('button'));
|
||||
});
|
||||
});
|
||||
@@ -1,26 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: MPL-2.0
|
||||
*/
|
||||
|
||||
import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'ember-qunit';
|
||||
import { render, find } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module('Integration | Component | rose/cards', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
await render(hbs`
|
||||
<Rose::Cards as |cards|>
|
||||
<cards.link
|
||||
@title="Card Title"
|
||||
@description="Description"
|
||||
/>
|
||||
</Rose::Cards>
|
||||
`);
|
||||
assert.ok(find('.rose-cards'));
|
||||
assert.ok(find('.rose-card-link'));
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user