Skip to content

Commit

Permalink
Unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mgiuffrida committed Sep 27, 2015
1 parent b745f45 commit de371bb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/unit/bind-elements.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
camel-case="{{value}}"
computed-inline="{{computeInline(value,add, divide)}}"
computed-inline2="{{computeInline(value, add,divide)}}"
computed-inline3="{{computeInline(value, add,
divide)}}"
computedattribute$="{{computeInline(value, add,divide)}}"
computedattribute2$="{{computeInline(
value, add, divide)}}"
neg-computed-inline="{{!computeInline(value,add,divide)}}"
computed-negative-number="{{computeNegativeNumber(-1)}}"
computed-negative-literal="{{computeNegativeNumber(-A)}}"
Expand All @@ -22,6 +26,8 @@
computed-from-tricky-function='{{$computeTrickyFunctionFromLiterals( 3, "foo")}}'
computed-from-tricky-literals="{{computeFromTrickyLiterals(3, 'tricky\,\'zot\'')}}"
computed-from-tricky-literals2='{{computeFromTrickyLiterals(3,"tricky\,'zot'" )}}'
computed-from-tricky-literals3='{{computeFromTrickyLiterals(3,
"tricky\,'zot'" )}}'
computed-from-no-args="{{computeFromNoArgs( )}}"
no-computed="{{foobared(noInlineComputed)}}"
>
Expand Down
3 changes: 3 additions & 0 deletions test/unit/bind.html
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
assert.equal(el.$.boundChild.computedFromTrickyFunction, '3foo', 'Wrong result from tricky function with pure literal arg computation');
assert.equal(el.$.boundChild.computedFromTrickyLiterals, '3tricky,\'zot\'', 'Wrong result from tricky literal arg computation');
assert.equal(el.$.boundChild.computedFromTrickyLiterals2, '3tricky,\'zot\'', 'Wrong result from tricky literal arg computation');
assert.equal(el.$.boundChild.computedFromTrickyLiterals3, '3tricky,\'zot\'', 'Wrong result from tricky literal arg computation');
assert.equal(el.$.computedContent.textContent, '3tricky,\'zot\'', 'Wrong textContent from tricky literal arg computation');
});

Expand Down Expand Up @@ -224,6 +225,7 @@
el.divide = 3;
assert.equal(el.$.boundChild.computedInline, 20, 'computedInline not correct');
assert.equal(el.$.boundChild.computedInline2, 20, 'computedInline2 not correct');
assert.equal(el.$.boundChild.computedInline3, 20, 'computedInline3 not correct');
assert.equal(el.$.boundChild.negComputedInline, false, 'negComputedInline not correct');
});

Expand All @@ -232,6 +234,7 @@
el.add = 40;
el.divide = 3;
assert.equal(el.$.boundChild.getAttribute('computedattribute'), 20, 'computed attribute not correct');
assert.equal(el.$.boundChild.getAttribute('computedattribute2'), 20, 'computed attribute not correct');
});

test('annotated style attribute binding', function() {
Expand Down

0 comments on commit de371bb

Please sign in to comment.