Skip to content

Commit a8c2053

Browse files
committed
fixed tests
1 parent 524398d commit a8c2053

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ImperaJS
22

3-
Tiny, Proxy based, custom-elements centric App State Managment.
3+
Tiny, Proxy based App State Managment for custom-elements
44

55
# Main Features
66

test/stateMixin.test.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export default function(){
4848
on_num_update(){ b_n++; }
4949
on_obj_update(){b_obj++;}
5050
on_str_update(){b_s++;}
51-
on_count_update(){b_tr++}
51+
on_count(){b_tr++}
5252
gotMessage_mess(input){message2 = input.message;}
5353
} );
5454

@@ -117,19 +117,23 @@ export default function(){
117117
chai.assert.equal(b_tr ,1, "transition ");
118118
ist.applyTransition("count",{val:7});
119119
chai.assert.equal(c_tr ,7, "transition fake2");
120+
// it is two because if it is stateVariable on attachment needs to run the side effects of element
120121
chai.assert.equal(b_tr ,2, "transition ");
121122

122123
sv_n.value = 23;
123124
chai.assert.equal(c_n ,1, "var num fake watcher");
124-
chai.assert.equal(b_n ,1, "var num: ");
125+
// it is two because if it is stateVariable on attachment needs to run the side effects of element
126+
chai.assert.equal(b_n ,2, "var num: ");
125127

126128
sv_s.value = "po";
127129
chai.assert.equal(c_s ,1, "var str fake watcher");
128-
chai.assert.equal(b_s ,1, "var str");
130+
// it is two because if it is stateVariable on attachment needs to run the side effects of element
131+
chai.assert.equal(b_s ,2, "var str");
129132

130133
sv_obj.value = {hey:"dude"};
131134
chai.assert.equal(c_obj ,1, "var obj fake watcher");
132-
chai.assert.equal(b_obj ,1, "var obj ");
135+
// it is two because if it is stateVariable on attachment needs to run the side effects of element
136+
chai.assert.equal(b_obj ,2, "var obj ");
133137

134138
ist.sendMessageOnChannel("mess",{message:"ciao"});
135139
chai.assert.equal(message,"ciao", "message is sent");

0 commit comments

Comments
 (0)