refactor: CopyButton to Copyable component

This commit is contained in:
Susmitha Girumala committed 2020-09-29 15:08:21 -04:00
1 parent c937d94822
commit 788dab94ca
7 files changed
+46 -39

No files matched your search

@@ -1,14 +0,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 | copy-button', function(hooks) {
setupRenderingTest(hooks);
test('it renders', async function(assert) {
await render(hbs`<CopyButton>text</CopyButton>`);
assert.ok(find('.copy-button'));
assert.equal(find('.copy-target').textContent.trim(), 'text');
});
});
@@ -0,0 +1,15 @@
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 | copyable', function(hooks) {
setupRenderingTest(hooks);
test('it renders', async function(assert) {
await render(hbs`<Copyable @text="Copy me">text</Copyable>`);
assert.ok(find('.copyable'));
assert.equal(find('.copyable-content').textContent.trim(), 'text');
assert.equal(find('.copyable-button').textContent.trim(), 'Copy me');
});
});