Skip to content

Commit

Permalink
Merge pull request #19 from qonto/fix-strict-equal
Browse files Browse the repository at this point in the history
Use assert.strictEqual instead of assert.equal
  • Loading branch information
crushjz authored Apr 11, 2023
2 parents e7dc4a6 + e652d0b commit 1f98a4d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 23 deletions.
14 changes: 7 additions & 7 deletions tests/integration/components/prismic/dom-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module('Integration | Component | prismic/dom', function (hooks) {
module('single elements', function () {
test('renders string', async function (assert) {
await render(hbs`<Prismic::Dom @nodes='some text' />`);
assert.equal(cleanHtml(this), '<div>some text</div>');
assert.strictEqual(cleanHtml(this), '<div>some text</div>');
});
});

Expand All @@ -36,7 +36,7 @@ module('Integration | Component | prismic/dom', function (hooks) {
await render(
hbs`<Prismic::Dom @nodes={{this.nodes}} @hyperlink='hyperlink'/>`
);
assert.equal(
assert.strictEqual(
cleanHtml(this),
'<div><p>A <a href="https://example.org">link</a> to somewhere</p></div>'
);
Expand All @@ -54,14 +54,14 @@ module('Integration | Component | prismic/dom', function (hooks) {
hbs`<Prismic::Dom @nodes={{this.nodes}} @group-list-item='group-list-item' @list-item={{this.listItem}}/>`
);

assert.equal(
assert.strictEqual(
cleanHtml(this),
'<div><ul><li>one</li><li>two</li>elephant</ul></div>'
);

this.set('listItem', 'list-item');

assert.equal(
assert.strictEqual(
cleanHtml(this),
'<div><ul><li>one bananna</li><li>two bananna</li>elephant</ul></div>'
);
Expand All @@ -77,7 +77,7 @@ module('Integration | Component | prismic/dom', function (hooks) {

await render(hbs`<Prismic::Dom @nodes={{this.nodes}} />`);

assert.equal(
assert.strictEqual(
cleanHtml(this),
'<div><ol><li>one</li><li>two</li></ol></div>'
);
Expand All @@ -97,7 +97,7 @@ module('Integration | Component | prismic/dom', function (hooks) {

await render(hbs`<Prismic::Dom @nodes={{this.nodes}} />`);

assert.equal(
assert.strictEqual(
cleanHtml(this),
'<div><p>This is some text with <strong>overla</strong><em><strong>pp</strong>ings</em> spans and here</p></div>'
);
Expand All @@ -123,7 +123,7 @@ module('Integration | Component | prismic/dom', function (hooks) {

await render(hbs`<Prismic::Dom @nodes={{this.nodes}} />`);

assert.equal(
assert.strictEqual(
cleanHtml(this),
'<div><p><em>A </em><a href="https://example.org" rel="noreferrer noopener" target="_blank"><em>li<strong></strong></em><strong>nk</strong></a><strong> wi</strong>th overlap</p></div>'
);
Expand Down
29 changes: 16 additions & 13 deletions tests/integration/components/prismic/element-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module('Integration | Component | prismic/element', function (hooks) {
await render(
hbs`<Prismic::Element @node={{this.node}} @onUnknownTag={{this.onUnknownTag}} />`
);
assert.equal(cleanHtml(this), '<!---->', 'not displayed');
assert.strictEqual(cleanHtml(this), '<!---->', 'not displayed');
});

test('em', async function (assert) {
Expand All @@ -39,7 +39,7 @@ module('Integration | Component | prismic/element', function (hooks) {
},
};
await render(hbs`<Prismic::Element @node={{this.node}} />`);
assert.equal(
assert.strictEqual(
cleanHtml(this),
'<em>Qonto The all-in-one business account</em>'
);
Expand All @@ -55,7 +55,7 @@ module('Integration | Component | prismic/element', function (hooks) {
},
};
await render(hbs`<Prismic::Element @node={{this.node}} />`);
assert.equal(
assert.strictEqual(
cleanHtml(this),
'<h1>Qonto The all-in-one business account</h1>'
);
Expand Down Expand Up @@ -85,7 +85,7 @@ module('Integration | Component | prismic/element', function (hooks) {
text: 'example',
};
await render(hbs`<Prismic::Element @node={{this.node}} />`);
assert.equal(
assert.strictEqual(
cleanHtml(this),
'<a href="https://example.org" rel="noreferrer noopener" target="_blank">example</a>'
);
Expand All @@ -105,7 +105,7 @@ module('Integration | Component | prismic/element', function (hooks) {
},
};
await render(hbs`<Prismic::Element @node={{this.node}} />`);
assert.equal(
assert.strictEqual(
cleanHtml(this),
'<img alt="Qonto The all-in-one business account" copyright="qonto" src="/assets/img/connect/slack.png" width="500" height="400">'
);
Expand All @@ -121,7 +121,7 @@ module('Integration | Component | prismic/element', function (hooks) {
},
};
await render(hbs`<Prismic::Element @node={{this.node}} />`);
assert.equal(
assert.strictEqual(
cleanHtml(this),
'<p>Qonto The all-in-one business account</p>'
);
Expand All @@ -137,7 +137,10 @@ module('Integration | Component | prismic/element', function (hooks) {
},
};
await render(hbs`<Prismic::Element @node={{this.node}} />`);
assert.equal(cleanHtml(this), 'Qonto The all-in-one business account');
assert.strictEqual(
cleanHtml(this),
'Qonto The all-in-one business account'
);
});

test('preformatted', async function (assert) {
Expand All @@ -150,7 +153,7 @@ module('Integration | Component | prismic/element', function (hooks) {
},
};
await render(hbs`<Prismic::Element @node={{this.node}} />`);
assert.equal(
assert.strictEqual(
cleanHtml(this),
'<pre>Qonto The all-in-one business account</pre>'
);
Expand All @@ -166,7 +169,7 @@ module('Integration | Component | prismic/element', function (hooks) {
},
};
await render(hbs`<Prismic::Element @node={{this.node}} />`);
assert.equal(
assert.strictEqual(
cleanHtml(this),
'<strong>Qonto The all-in-one business account</strong>'
);
Expand All @@ -182,7 +185,7 @@ module('Integration | Component | prismic/element', function (hooks) {
},
};
await render(hbs`<Prismic::Element @node={{this.node}} />`);
assert.equal(
assert.strictEqual(
cleanHtml(this),
'<label>Qonto The all-in-one business account</label>'
);
Expand Down Expand Up @@ -214,7 +217,7 @@ module('Integration | Component | prismic/element', function (hooks) {
],
};
await render(hbs`<Prismic::Element @node={{this.node}} />`);
assert.equal(cleanHtml(this), '<ul><li>one</li><li>two</li></ul>');
assert.strictEqual(cleanHtml(this), '<ul><li>one</li><li>two</li></ul>');
});

test('it renders', async function (assert) {
Expand Down Expand Up @@ -311,7 +314,7 @@ module('Integration | Component | prismic/element', function (hooks) {

await render(hbs`<Prismic::Element @node={{this.node}} />`);

assert.equal(
assert.strictEqual(
cleanHtml(this),
'<p>This is some text with <strong>overla</strong><em><strong>pp</strong>ings</em> spans and here</p>'
);
Expand Down Expand Up @@ -447,7 +450,7 @@ module('Integration | Component | prismic/element', function (hooks) {

await render(hbs`<Prismic::Element @node={{this.node}} />`);

assert.equal(
assert.strictEqual(
cleanHtml(this),
'<p><em>A </em><a href="https://example.org" rel="noreferrer noopener" target="_blank"><em>li<strong></strong></em><strong>nk</strong></a><strong> wi</strong>th overlap</p>'
);
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/components/prismic/image-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module('Integration | Component | prismic/image', function (hooks) {
},
};
await render(hbs`<Prismic::Image @node={{this.node}} />`);
assert.equal(
assert.strictEqual(
cleanHtml(this),
'<img alt="Qonto The all-in-one business account" copyright="qonto" src="/assets/img/connect/slack.png" width="500" height="400">'
);
Expand All @@ -44,7 +44,7 @@ module('Integration | Component | prismic/image', function (hooks) {
},
};
await render(hbs`<Prismic::Image @node={{this.node}} />`);
assert.equal(
assert.strictEqual(
cleanHtml(this),
'<a href="https://example.org" target="_blank" rel="noreferrer noopener"><img alt="Qonto The all-in-one business account" copyright="qonto" src="/assets/img/connect/slack.png" width="500" height="400"></a>'
);
Expand All @@ -66,7 +66,7 @@ module('Integration | Component | prismic/image', function (hooks) {
},
};
await render(hbs`<Prismic::Image @node={{this.node}} />`);
assert.equal(
assert.strictEqual(
cleanHtml(this),
'<a href="https://example.org" target="_top" rel="noreferrer noopener"><img alt="Qonto The all-in-one business account" copyright="qonto" src="/assets/img/connect/slack.png" width="500" height="400"></a>'
);
Expand Down

0 comments on commit 1f98a4d

Please sign in to comment.