diff --git a/addon/components/table/cell/currency.hbs b/addon/components/table/cell/currency.hbs new file mode 100644 index 0000000..45d60a5 --- /dev/null +++ b/addon/components/table/cell/currency.hbs @@ -0,0 +1,5 @@ + + {{#let (or @row.currency @column.currency) as |currency|}} + {{format-currency @value currency}} + {{/let}} + \ No newline at end of file diff --git a/app/components/table/cell/currency.js b/app/components/table/cell/currency.js new file mode 100644 index 0000000..e5136ee --- /dev/null +++ b/app/components/table/cell/currency.js @@ -0,0 +1 @@ +export { default } from '@fleetbase/ember-ui/components/table/cell/currency'; diff --git a/tests/integration/components/table/cell/currency-test.js b/tests/integration/components/table/cell/currency-test.js new file mode 100644 index 0000000..bb2649e --- /dev/null +++ b/tests/integration/components/table/cell/currency-test.js @@ -0,0 +1,26 @@ +import { module, test } from 'qunit'; +import { setupRenderingTest } from 'dummy/tests/helpers'; +import { render } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; + +module('Integration | Component | table/cell/currency', function (hooks) { + setupRenderingTest(hooks); + + test('it renders', async function (assert) { + // Set any properties with this.set('myProperty', 'value'); + // Handle any actions with this.set('myAction', function(val) { ... }); + + await render(hbs``); + + assert.dom().hasText(''); + + // Template block usage: + await render(hbs` + + template block text + + `); + + assert.dom().hasText('template block text'); + }); +});