Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
With `legacyUndefined` only multi-property effects should not be run when an argument is undefined; single property effects should always run.
  • Loading branch information
Steven Orvell committed Feb 14, 2019
1 parent 6139e88 commit 32c3083
Showing 1 changed file with 58 additions and 59 deletions.
117 changes: 58 additions & 59 deletions test/unit/legacy-undefined.html
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
setupElement({singleProp});
assertEffects({singlePropObserver: 1});
el.singleProp = undefined;
assertEffects({singlePropObserver: 1});
assertEffects({singlePropObserver: 2});
});
test('one multiPropObserver arguments undefined', () => {
setupElement({multiProp1, multiProp2});
Expand Down Expand Up @@ -277,65 +277,64 @@

teardown(() => console.warn.restore());

suite('warn', () => {
test('no arguments defined', () => {
el = fixture('declarative-none');
assertEffects({});
});
test('singlePropObserver argument defined', () => {
el = fixture('declarative-single');
assertEffects({singlePropObserver: 1});
});
test('one multiPropObserver arguments defined', () => {
el = fixture('declarative-multi-one');
assertEffects({multiPropObserver: 0});
});
test('all multiPropObserver defined', () => {
el = fixture('declarative-multi-all');
assertEffects({multiPropObserver: 1});
});
test('computeSingle argument defined', () => {
el = fixture('declarative-single-computed');
assertEffects({computeSingle: 1});
assert.equal(el.computedSingle, '[a]');
});
test('one computeMulti arguments defined', () => {
el = fixture('declarative-multi-one-computed');
assertEffects({computeMulti: 0});
assert.equal(el.computedMulti, undefined);
});
test('all computeMulti defined', () => {
el = fixture('declarative-multi-all-computed');
assert.equal(el.computedMulti, '[b,c]');
});
test('inline computeSingle argument defined', () => {
el = fixture('declarative-single-computed-inline');
assertEffects({computeSingle: 1});
assert.equal(el.$.child.computedSingle, '[a]');
});
test('inline one computeMulti arguments defined', () => {
el = fixture('declarative-multi-one-computed-inline');
assertEffects({computeMulti: 0});
assert.equal(el.$.child.computedMulti, undefined);
});
test('inline all computeMulti defined', () => {
el = fixture('declarative-multi-all-computed-inline');
assertEffects({computeMulti: 1});
assert.equal(el.$.child.computedMulti, '[b,c]');
});
test('one inline computeMulti argument defined in dom-if', () => {
el = fixture('declarative-multi-if-one-computed-inline');
flush();
assertEffects({computeMulti: 0});
assert.equal(el.$$('#ifChild').computedMulti, undefined);
});
test('all inline computeMulti argument defined in dom-if', () => {
el = fixture('declarative-multi-if-all-computed-inline');
flush();
assertEffects({computeMulti: 1});
assert.equal(el.$$('#ifChild').computedMulti, '[b,c]');
});
test('no arguments defined', () => {
el = fixture('declarative-none');
assertEffects({});
});
test('singlePropObserver argument defined', () => {
el = fixture('declarative-single');
assertEffects({singlePropObserver: 1});
});
test('one multiPropObserver arguments defined', () => {
el = fixture('declarative-multi-one');
assertEffects({multiPropObserver: 0});
});
test('all multiPropObserver defined', () => {
el = fixture('declarative-multi-all');
assertEffects({multiPropObserver: 1});
});
test('computeSingle argument defined', () => {
el = fixture('declarative-single-computed');
assertEffects({computeSingle: 1});
assert.equal(el.computedSingle, '[a]');
});
test('one computeMulti arguments defined', () => {
el = fixture('declarative-multi-one-computed');
assertEffects({computeMulti: 0});
assert.equal(el.computedMulti, undefined);
});
test('all computeMulti defined', () => {
el = fixture('declarative-multi-all-computed');
assert.equal(el.computedMulti, '[b,c]');
});
test('inline computeSingle argument defined', () => {
el = fixture('declarative-single-computed-inline');
assertEffects({computeSingle: 1});
assert.equal(el.$.child.computedSingle, '[a]');
});
test('inline one computeMulti arguments defined', () => {
el = fixture('declarative-multi-one-computed-inline');
assertEffects({computeMulti: 0});
assert.equal(el.$.child.computedMulti, undefined);
});
test('inline all computeMulti defined', () => {
el = fixture('declarative-multi-all-computed-inline');
assertEffects({computeMulti: 1});
assert.equal(el.$.child.computedMulti, '[b,c]');
});
test('one inline computeMulti argument defined in dom-if', () => {
el = fixture('declarative-multi-if-one-computed-inline');
flush();
assertEffects({computeMulti: 0});
assert.equal(el.$$('#ifChild').computedMulti, undefined);
});
test('all inline computeMulti argument defined in dom-if', () => {
el = fixture('declarative-multi-if-all-computed-inline');
flush();
assertEffects({computeMulti: 1});
assert.equal(el.$$('#ifChild').computedMulti, '[b,c]');
});

});

</script>
Expand Down

0 comments on commit 32c3083

Please sign in to comment.