Skip to content

Commit

Permalink
Merge pull request #20 from fleetbase/add-get-dot-prop-helper
Browse files Browse the repository at this point in the history
add get dot prop helper
  • Loading branch information
roncodes authored Sep 29, 2023
2 parents 4a696bf + f41d72f commit 6295217
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions addon/helpers/get-dot-prop.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { helper } from '@ember/component/helper';

export default helper(function getDotProp([object, key]) {
return object[key];
});
1 change: 1 addition & 0 deletions app/helpers/get-dot-prop.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from '@fleetbase/ember-ui/helpers/get-dot-prop';
17 changes: 17 additions & 0 deletions tests/integration/helpers/get-dot-prop-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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 | Helper | get-dot-prop', function (hooks) {
setupRenderingTest(hooks);

// TODO: Replace this with your real tests.
test('it renders', async function (assert) {
this.set('inputValue', '1234');

await render(hbs`{{get-dot-prop this.inputValue}}`);

assert.dom(this.element).hasText('1234');
});
});

0 comments on commit 6295217

Please sign in to comment.