Skip to content

Commit

Permalink
refactor: make advertisement-tool-test ts
Browse files Browse the repository at this point in the history
  • Loading branch information
guidojw committed Dec 31, 2022
1 parent 7d4f25e commit faeea33
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 5 additions & 1 deletion app/components/advertisement-tool.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
<div class='d-flex adv-row flex-column flex-wrap justify-content-center'>
{{#each advertisements as |advertisement index|}}
{{#if advertisement.links}}
<div class='advertisement-item advertisement-item--full col-auto'>
<div
class='advertisement-item advertisement-item--full col-auto'
data-test-advertisement-item
>
{{#each advertisement.links as |link|}}
<a
class='d-block text-primary'
Expand All @@ -22,6 +25,7 @@
href={{advertisement.link}}
title={{advertisement.title}}
target='_blank'
data-test-advertisement-item
>
<img
src={{advertisement.image}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ module('Integration | Component | advertisement-tool', function (hooks) {
test('should render all ads', async function (assert) {
assert.expect(1);

await render(hbs`{{advertisement-tool}}`);
await render(hbs`<AdvertisementTool />`);

assert.equal(
this.element.querySelectorAll('.advertisement-item').length,
34 // Number of advertisements times two
);
// Number of advertisements times two
assert.dom('[data-test-advertisement-item]').exists({ count: 34 });
});
});

0 comments on commit faeea33

Please sign in to comment.