From 9bc5dee4c7e90ef7a6cef36bd9f8cdaa236cec11 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Tue, 9 Jun 2020 14:17:56 -0400 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20Remove=20text=20attr?= =?UTF-8?q?ibute=20in=20table=20cell=20rose=20component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of providing table cell content using ``, update allows for content to be defined within tags `something` --- .../addon/components/rose/table.stories.mdx | 36 +++++++++---------- .../templates/components/rose/table/cell.hbs | 2 -- .../rose/tests/dummy/app/templates/index.hbs | 18 +++++----- .../components/rose/table/cell-test.js | 7 ++++ 4 files changed, 34 insertions(+), 29 deletions(-) diff --git a/addons/rose/addon/components/rose/table.stories.mdx b/addons/rose/addon/components/rose/table.stories.mdx index 353980423..0af8d7d0b 100644 --- a/addons/rose/addon/components/rose/table.stories.mdx +++ b/addons/rose/addon/components/rose/table.stories.mdx @@ -13,23 +13,23 @@ A table component to display data in structure of rows and columns. It supports - - - - + Address + Host Set + Name + Description - - - - + 1.1.1.1 + host-set-1, host-set-2 + optional name + description - + Footer @@ -41,23 +41,23 @@ A table component to display data in structure of rows and columns. It supports - - - - + Address + Host Set + Name + Description - - - - + 1.1.1.1 + host-set-1, host-set-2 + optional name + description - + Footer diff --git a/addons/rose/addon/templates/components/rose/table/cell.hbs b/addons/rose/addon/templates/components/rose/table/cell.hbs index 211909d86..5cfc41c8d 100644 --- a/addons/rose/addon/templates/components/rose/table/cell.hbs +++ b/addons/rose/addon/templates/components/rose/table/cell.hbs @@ -1,11 +1,9 @@ {{#if @header}} - {{@text}} {{yield}} {{else}} - {{@text}} {{yield}} {{/if}} diff --git a/addons/rose/tests/dummy/app/templates/index.hbs b/addons/rose/tests/dummy/app/templates/index.hbs index cd1600429..3554ea5f2 100644 --- a/addons/rose/tests/dummy/app/templates/index.hbs +++ b/addons/rose/tests/dummy/app/templates/index.hbs @@ -1,23 +1,23 @@ - - - - + Address + Host Set + Name + Description - - - - + 1.1.1.1 + host-set-1, host-set-2 + optional name + description - + Footer diff --git a/addons/rose/tests/integration/components/rose/table/cell-test.js b/addons/rose/tests/integration/components/rose/table/cell-test.js index 10a88e890..aeec60376 100644 --- a/addons/rose/tests/integration/components/rose/table/cell-test.js +++ b/addons/rose/tests/integration/components/rose/table/cell-test.js @@ -18,6 +18,13 @@ module('Integration | Component | rose/table/cell', function (hooks) { assert.ok(find('#cell')); }); + test('it renders with content', async function (assert) { + await render(hbs` + Cell content + `); + assert.equal(find('.rose-table-cell').textContent.trim(), 'Cell content'); + }); + test('it renders as header cell', async function (assert) { await render(hbs``); assert.ok(find('.rose-table-cell'));