Skip to content

Commit

Permalink
Use br el instead of text (#1233)
Browse files Browse the repository at this point in the history
  • Loading branch information
rpoet-jh authored Oct 19, 2023
1 parent 368002b commit 202e9c5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/components/submissions-award-cell/index.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{{#each @record.grants as |grant index|}}
{{if index ",<br>"}}
{{#if index}}
<span>,</span><br />
{{/if}}
<LinkTo @route="grants.detail" @model={{grant.id}}>{{grant.awardNumber}}</LinkTo>
({{grant.primaryFunder.name}})
{{else}}
Expand Down
25 changes: 24 additions & 1 deletion tests/integration/components/submissions-award-cell-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,31 @@ module('Integration | Component | submissions award cell', (hooks) => {
setupRenderingTest(hooks);

test('it renders', async function (assert) {
await render(hbs`<SubmissionsAwardCell />`);
const record = {
grants: [
{
id: 'test-id-1',
detail: 'test-detail-1',
awardNumber: 'test-awdnum-1',
primaryFunder: { name: 'test-pfname-1' },
},
{
id: 'test-id-2',
detail: 'test-detail-2',
awardNumber: 'test-awdnum-2',
primaryFunder: { name: 'test-pfname-2' },
},
],
};
this.set('record', record);

await render(hbs`<SubmissionsAwardCell @record={{this.record}} />`);

assert.ok(true);
assert.equal(
this.element.textContent.trim(),
'test-awdnum-1\n (test-pfname-1)\n ,\n test-awdnum-2\n (test-pfname-2)',
'render many awards correctly'
);
});
});

0 comments on commit 202e9c5

Please sign in to comment.