Skip to content

Commit

Permalink
Remove surrounding whitespace around icon
Browse files Browse the repository at this point in the history
  • Loading branch information
rykov committed Feb 15, 2022
1 parent 2b5b1c3 commit 569f3e6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addon/components/fa-icon.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{#if this.iconExists}}
{{~#if this.iconExists~}}
<svg
style={{this.safeStyle}}
class={{this.iconAttributes.class}}
Expand All @@ -17,4 +17,4 @@
>
{{this.content}}
</svg>
{{/if}}
{{~/if~}}
7 changes: 7 additions & 0 deletions tests/integration/components/fa-icon-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,11 @@ module('Integration | Component | fa icon', function (hooks) {
assert.dom('svg').hasAttribute('x', '2');
assert.dom('svg').hasAttribute('y', '2');
});

test('it renders no surrounding whitespace', async function (assert) {
this.set('faCoffee', faCoffee);
await render(hbs`<FaIcon @icon={{this.faCoffee}} />`);
assert.ok(this.element.innerHTML.startsWith('<svg '));
assert.ok(this.element.innerHTML.endsWith('</svg>'));
});
});

0 comments on commit 569f3e6

Please sign in to comment.