Add specs for the show and hide binding routines.
Showing
1 changed file
with
32 additions
and
0 deletions
... | @@ -73,6 +73,38 @@ describe('Rivets', function() { | ... | @@ -73,6 +73,38 @@ describe('Rivets', function() { |
73 | expect(input.value).toBe('pitchfork'); | 73 | expect(input.value).toBe('pitchfork'); |
74 | }); | 74 | }); |
75 | }); | 75 | }); |
76 | |||
77 | describe('show', function() { | ||
78 | describe('with a truthy value', function() { | ||
79 | it('shows the element', function() { | ||
80 | rivets.routines.show(el, true); | ||
81 | expect(el.style.display).toBe(''); | ||
82 | }); | ||
83 | }); | ||
84 | |||
85 | describe('with a falsey value', function() { | ||
86 | it('hides the element', function() { | ||
87 | rivets.routines.show(el, false); | ||
88 | expect(el.style.display).toBe('none'); | ||
89 | }); | ||
90 | }); | ||
91 | }); | ||
92 | |||
93 | describe('hide', function() { | ||
94 | describe('with a truthy value', function() { | ||
95 | it('hides the element', function() { | ||
96 | rivets.routines.hide(el, true); | ||
97 | expect(el.style.display).toBe('none'); | ||
98 | }); | ||
99 | }); | ||
100 | |||
101 | describe('with a falsey value', function() { | ||
102 | it('shows the element', function() { | ||
103 | rivets.routines.hide(el, false); | ||
104 | expect(el.style.display).toBe(''); | ||
105 | }); | ||
106 | }); | ||
107 | }); | ||
76 | }); | 108 | }); |
77 | 109 | ||
78 | describe('Binds', function() { | 110 | describe('Binds', function() { | ... | ... |
-
Please register or sign in to post a comment