-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #163 w-for was not being removed
- Loading branch information
Phillip Gates-Idem
committed
Oct 12, 2016
1 parent
c9e94eb
commit 76da236
Showing
6 changed files
with
30 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,5 +40,6 @@ | |
"eqeqeq": false, | ||
"latedef": true, | ||
"unused": "vars", | ||
"eqnull": true | ||
"eqnull": true, | ||
"expr": true | ||
} |
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,7 @@ | ||
module.exports = require('marko-widgets').defineComponent({ | ||
template: require('./template.marko'), | ||
|
||
init: function() { | ||
|
||
} | ||
}); |
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,4 @@ | ||
<div w-bind> | ||
<label w-id="label" w-for="input">foo</label> | ||
<input w-id="input" value="test"> | ||
</div> |
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,12 @@ | ||
var expect = require('chai').expect; | ||
|
||
module.exports = function(helpers) { | ||
var widget = helpers.mount(require('./index'), {}); | ||
var label = widget.getEl('label'); | ||
var forElId = label.getAttribute('for'); | ||
var inputEl = document.getElementById(forElId); | ||
|
||
expect(forElId).to.exist; | ||
expect(inputEl.value).to.equal('test'); | ||
expect(label.getAttribute('w-for')).to.equal(null); | ||
}; |