-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12370 from Kuzirashi/master
[BUGFIX canary] Deprecate passing function as test argument to deprecate/warn/assert
- Loading branch information
Showing
10 changed files
with
161 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
packages/ember-htmlbars/tests/node-managers/view-node-manager-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import ViewNodeManager from 'ember-htmlbars/node-managers/view-node-manager'; | ||
|
||
QUnit.module('ember-htmlbars: node-managers - ViewNodeManager'); | ||
|
||
QUnit.test('create method should assert if component hasn\'t been found', assert => { | ||
assert.expect(1); | ||
|
||
let found = { | ||
component: null, | ||
layout: null | ||
}; | ||
|
||
let path; | ||
|
||
expectAssertion(() => { | ||
ViewNodeManager.create(null, null, null, found, null, path); | ||
}, 'HTMLBars error: Could not find component named "' + path + '" (no component or template with that name was found)'); | ||
}); | ||
|
||
QUnit.test('create method shouldn\'t assert if `found.component` is truthy', assert => { | ||
assert.expect(1); | ||
|
||
let found = { | ||
component: {}, | ||
layout: null | ||
}; | ||
let attrs = {}; | ||
let renderNode = {}; | ||
|
||
let env = { | ||
renderer: { | ||
componentUpdateAttrs() { | ||
assert.ok('env.renderer.componentUpdateAttrs called'); | ||
} | ||
} | ||
}; | ||
|
||
ViewNodeManager.create(renderNode, env, attrs, found); | ||
}); | ||
|
||
QUnit.test('create method shouldn\'t assert if `found.layout` is truthy', assert => { | ||
assert.expect(0); | ||
|
||
let found = { | ||
component: null, | ||
layout: true | ||
}; | ||
|
||
ViewNodeManager.create(null, null, null, found); | ||
}); | ||
|
||
QUnit.test('create method shouldn\'t assert if `path` is falsy and `contentTemplate` is truthy', assert => { | ||
assert.expect(0); | ||
|
||
let found = { | ||
component: null, | ||
layout: null | ||
}; | ||
let path = null; | ||
let contentTemplate = true; | ||
|
||
ViewNodeManager.create(null, null, null, found, null, path, null, contentTemplate); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters