Skip to content

Commit

Permalink
Replace equal(textValue) with assertText
Browse files Browse the repository at this point in the history
This commit changes all `equal(this.textValue(), expected)` for the added
`this.assertText`.

It adds a couple of parameters and adds a nice message too.
  • Loading branch information
Serabe committed Mar 7, 2016
1 parent 05a8498 commit b131c4a
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 59 deletions.
14 changes: 12 additions & 2 deletions packages/ember-glimmer/tests/utils/abstract-test-case.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,18 @@ export class RenderingTest extends TestCase {
return this.$(sel).text();
}

assertText(text) {
assert.strictEqual(this.textValue(), text, '#qunit-fixture content');
assertText(text, sel, msg) {
let errorText;

if (msg) {
errorText = msg;
} else if (sel) {
errorText = `text in ${sel} was expected to be ${text} but found ${text}`;
} else {
errorText = `text was expected to be ${text} but found ${text}`;
}

assert.strictEqual(this.textValue(sel), text, errorText);
}

assertHTML(html) {
Expand Down
Loading

0 comments on commit b131c4a

Please sign in to comment.