From c3e6ebc0cba8f937579de0814e99dceaaf06fdba Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Tue, 16 Jun 2020 10:27:59 -0400 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20Remove=20disabled=20?= =?UTF-8?q?property=20on=20rose=20link=20button?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/rose/link-button.stories.mdx | 3 +-- .../templates/components/rose/link-button.hbs | 1 - .../rose/app/components/rose/link-button.js | 2 +- .../rose/tests/dummy/app/templates/index.hbs | 6 +---- .../components/rose/link-button-test.js | 27 +++++++++---------- 5 files changed, 15 insertions(+), 24 deletions(-) diff --git a/addons/rose/addon/components/rose/link-button.stories.mdx b/addons/rose/addon/components/rose/link-button.stories.mdx index b29afbcd0..cb6b13001 100644 --- a/addons/rose/addon/components/rose/link-button.stories.mdx +++ b/addons/rose/addon/components/rose/link-button.stories.mdx @@ -9,6 +9,7 @@ import { text, boolean, select } from '@storybook/addon-knobs'; An achor element component styled to mimic `Rose::Button` component. Styles supported: primary, secondary, warning, and ghost. +Disabling link button is not supported as it is an action on form components only. ```html @@ -20,7 +21,6 @@ Styles supported: primary, secondary, warning, and ghost. {{ template: hbs` diff --git a/addons/rose/app/components/rose/link-button.js b/addons/rose/app/components/rose/link-button.js index 6dc4bbe0a..d3537e621 100644 --- a/addons/rose/app/components/rose/link-button.js +++ b/addons/rose/app/components/rose/link-button.js @@ -1 +1 @@ -export { default } from 'rose/components/rose/link-button'; \ No newline at end of file +export { default } from 'rose/components/rose/link-button'; diff --git a/addons/rose/tests/dummy/app/templates/index.hbs b/addons/rose/tests/dummy/app/templates/index.hbs index c12b92974..8df466fc3 100644 --- a/addons/rose/tests/dummy/app/templates/index.hbs +++ b/addons/rose/tests/dummy/app/templates/index.hbs @@ -3,11 +3,7 @@ Warning Ghost
-Primary -Secondary -Warning -Ghost -
+ Left Icon Right Icon diff --git a/addons/rose/tests/integration/components/rose/link-button-test.js b/addons/rose/tests/integration/components/rose/link-button-test.js index 6ef4f71ba..d7d3c8497 100644 --- a/addons/rose/tests/integration/components/rose/link-button-test.js +++ b/addons/rose/tests/integration/components/rose/link-button-test.js @@ -3,33 +3,30 @@ import { setupRenderingTest } from 'ember-qunit'; import { render, find } from '@ember/test-helpers'; import hbs from 'htmlbars-inline-precompile'; -module('Integration | Component | rose/link-button', function(hooks) { +module('Integration | Component | rose/link-button', function (hooks) { setupRenderingTest(hooks); - test('it renders', async function(assert) { + test('it renders', async function (assert) { await render(hbs``); assert.ok(find('a')); - assert.notOk(find('.disabled')); assert.notOk(find('.rose-button')); assert.ok(find('.rose-link-button')); }); - test('it renders with attributes', async function(assert) { + test('it renders with attributes', async function (assert) { await render(hbs``); assert.ok(find('#link-button')); }); - test('it renders with content', async function(assert) { + test('it renders with content', async function (assert) { await render(hbs`Link button content`); - assert.ok(find('.rose-link-button').textContent.trim(), 'Link button content'); + assert.ok( + find('.rose-link-button').textContent.trim(), + 'Link button content' + ); }); - test('it renders disabled when @disabled={{true}}', async function(assert) { - await render(hbs``); - assert.ok(find('.disabled')); - }); - - test('it renders with rose button styles', async function(assert) { + test('it renders with rose button styles', async function (assert) { this.set('style', 'primary'); await render(hbs``); assert.ok(find(`.rose-button-primary`)); @@ -38,19 +35,19 @@ module('Integration | Component | rose/link-button', function(hooks) { assert.ok(find(`.rose-button-sample`)); }); - test('it supports left icon with @iconLeft', async function(assert) { + test('it supports left icon with @iconLeft', async function (assert) { await render(hbs``); assert.ok(find('.rose-icon')); assert.ok(find('.has-icon-left')); }); - test('it supports left icon with @iconRight', async function(assert) { + test('it supports left icon with @iconRight', async function (assert) { await render(hbs``); assert.ok(find('.rose-icon')); assert.ok(find('.has-icon-right')); }); - test('it supports only icon with @iconOnly', async function(assert) { + test('it supports only icon with @iconOnly', async function (assert) { await render(hbs``); assert.ok(find('.rose-icon')); assert.ok(find('.has-icon-only'));