-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tests for object outputing + avoid duplicate events
- Loading branch information
Evan You
committed
Feb 13, 2014
1 parent
f2e32ab
commit 77ffd53
Showing
4 changed files
with
73 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<div id="test"> | ||
<p id="data">{{$data}}</p> | ||
<p id="obj">{{test}}</p> | ||
</div> | ||
|
||
<script src="../../../dist/vue.js"></script> | ||
|
||
<script> | ||
var test = new Vue({ | ||
el: '#test', | ||
data: { | ||
test: { | ||
prop: 1 | ||
} | ||
} | ||
}) | ||
</script> |
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,37 @@ | ||
casper.test.begin('Outputting Objects', 8, function (test) { | ||
|
||
casper | ||
.start('./fixtures/output-object.html') | ||
.then(function () { | ||
test.assertSelectorHasText('#data', '{"test":{"prop":1}}') | ||
test.assertSelectorHasText('#obj', '{"prop":1}') | ||
}) | ||
// setting a nested property | ||
.thenEvaluate(function () { | ||
test.test.prop = 2 | ||
}) | ||
.then(function () { | ||
test.assertSelectorHasText('#data', '{"test":{"prop":2}}') | ||
test.assertSelectorHasText('#obj', '{"prop":2}') | ||
}) | ||
// setting a nested object | ||
.thenEvaluate(function () { | ||
test.test = { hi:3 } | ||
}) | ||
.then(function () { | ||
test.assertSelectorHasText('#data', '{"test":{"hi":3}}') | ||
test.assertSelectorHasText('#obj', '{"hi":3}') | ||
}) | ||
// setting $data | ||
.thenEvaluate(function () { | ||
test.$data = { test: { swapped: true } } | ||
}) | ||
.then(function () { | ||
test.assertSelectorHasText('#data', '{"test":{"swapped":true}}') | ||
test.assertSelectorHasText('#obj', '{"swapped":true}') | ||
}) | ||
.run(function () { | ||
test.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