Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fix for removing jQuery dependency
- Loading branch information
Showing
12 changed files
with
64 additions
and
23 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
assert = assert or require?('chai').assert | ||
|
||
# https://github.com/kmalakoff/knockback/issues/159 | ||
describe 'issue 159 @issue159 @quick', -> | ||
kb = window?.kb; try kb or= require?('knockback') catch; try kb or= require?('../../../knockback') | ||
{_, ko} = kb | ||
$ = window?.$ | ||
|
||
it 'TEST DEPENDENCY MISSING', (done) -> | ||
assert.ok(!!ko, 'ko') | ||
assert.ok(!!_, '_') | ||
assert.ok(!!kb.Model, 'kb.Model') | ||
assert.ok(!!kb.Collection, 'kb.Collection') | ||
assert.ok(!!kb, 'kb') | ||
done() | ||
|
||
it 'has no issue', (done) -> | ||
return done() unless ($ and window?.document) | ||
|
||
kb.statistics = new kb.Statistics() # turn on stats | ||
|
||
class ViewModel | ||
afterRender: -> @was_called = true | ||
|
||
# test without options override | ||
view_model = new ViewModel() | ||
assert.ok(!view_model.was_called, 'afterRender not called yet') | ||
el = $('<script type="text/x-jquery-tmpl" id="the_template1"><div>...</div></script>') | ||
$('body').append(el) | ||
kb.renderTemplate('the_template1', view_model) | ||
assert.ok(view_model.was_called, 'afterRender was called') | ||
|
||
assert.equal(kb.statistics.registeredStatsString('all released'), 'all released', "Cleanup: stats"); kb.statistics = null | ||
done() |
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 is causing a bug, it should not be an undefined check since getAttribute returns null if is not set. Or you should rather use hasAttribute. #160