@@ -29,18 +29,18 @@ describe('.bindDirective', () => {
29
29
expect ( el . className ) . toEqual ( 'test2' ) ;
30
30
} ) ;
31
31
32
- // it('should not have className prop', () => {
33
- // const el = document.createElement('p');
34
- // const expression = '{ test: test }';
35
- // const state = { test: false };
36
- // bindDirective({
37
- // el,
38
- // parts: ['bind', 'class'],
39
- // data: { value: expression, compute: compute(expression, el), deps: [] },
40
- // state,
41
- // });
42
- // expect(el.className).toEqual('');
43
- // });
32
+ it ( 'should not have className prop' , ( ) => {
33
+ const el = document . createElement ( 'p' ) ;
34
+ const expression = '{ test: test }' ;
35
+ const state = { test : false } ;
36
+ bindDirective ( {
37
+ el,
38
+ parts : [ 'bind' , 'class' ] ,
39
+ data : { value : expression , compute : compute ( expression , el ) , deps : [ ] } ,
40
+ state,
41
+ } ) ;
42
+ expect ( el . className ) . toEqual ( '' ) ;
43
+ } ) ;
44
44
45
45
it ( 'should accept string for class' , ( ) => {
46
46
const el = document . createElement ( 'p' ) ;
@@ -68,18 +68,18 @@ describe('.bindDirective', () => {
68
68
expect ( el . className ) . toEqual ( 'foo bar baz' ) ;
69
69
} ) ;
70
70
71
- // it('should bind style based on state value', () => {
72
- // const el = document.createElement('p');
73
- // const expression = '{ fontWeight: test }';
74
- // const state = { test: 'bold' };
75
- // bindDirective({
76
- // el,
77
- // parts: ['bind', 'style'],
78
- // data: { value: expression, compute: compute(expression, el), deps: ['test'] },
79
- // state,
80
- // });
81
- // expect(el.style.cssText).toEqual('font-weight: bold;');
82
- // });
71
+ it ( 'should bind style based on state value' , ( ) => {
72
+ const el = document . createElement ( 'p' ) ;
73
+ const expression = '{ fontWeight: test }' ;
74
+ const state = { test : 'bold' } ;
75
+ bindDirective ( {
76
+ el,
77
+ parts : [ 'bind' , 'style' ] ,
78
+ data : { value : expression , compute : compute ( expression , el ) , deps : [ 'test' ] } ,
79
+ state,
80
+ } ) ;
81
+ expect ( el . style . cssText ) . toEqual ( 'font-weight: bold;' ) ;
82
+ } ) ;
83
83
84
84
it ( 'should bind href to anchor tag based on state value' , ( ) => {
85
85
const el = document . createElement ( 'a' ) ;
@@ -94,26 +94,26 @@ describe('.bindDirective', () => {
94
94
expect ( el . href ) . toEqual ( 'https://example.com/' ) ;
95
95
} ) ;
96
96
97
- // it('should allow boolean input for attributes', () => {
98
- // const el = document.createElement('a');
99
- // const expression = 'hideme';
100
- // let state = { hideme: true };
101
- // bindDirective({
102
- // el,
103
- // parts: ['bind', 'hidden'],
104
- // data: { value: expression, compute: compute(expression, el), deps: [] },
105
- // state,
106
- // });
107
- // expect(el.hidden).toEqual(true);
108
- // state = { hideme: false };
109
- // bindDirective({
110
- // el,
111
- // parts: ['bind', 'hidden'],
112
- // data: { value: expression, compute: compute(expression, el), deps: [] },
113
- // state,
114
- // });
115
- // expect(el.hidden).toEqual(false);
116
- // });
97
+ it ( 'should allow boolean input for attributes' , ( ) => {
98
+ const el = document . createElement ( 'a' ) ;
99
+ const expression = 'hideme' ;
100
+ let state = { hideme : true } ;
101
+ bindDirective ( {
102
+ el,
103
+ parts : [ 'bind' , 'hidden' ] ,
104
+ data : { value : expression , compute : compute ( expression , el ) , deps : [ ] } ,
105
+ state,
106
+ } ) ;
107
+ expect ( el . hidden ) . toEqual ( true ) ;
108
+ state = { hideme : false } ;
109
+ bindDirective ( {
110
+ el,
111
+ parts : [ 'bind' , 'hidden' ] ,
112
+ data : { value : expression , compute : compute ( expression , el ) , deps : [ ] } ,
113
+ state,
114
+ } ) ;
115
+ expect ( el . hidden ) . toEqual ( false ) ;
116
+ } ) ;
117
117
118
118
it ( 'should accept object format for attributes' , ( ) => {
119
119
const el = document . createElement ( 'a' ) ;
0 commit comments