File tree Expand file tree Collapse file tree 2 files changed +37
-7
lines changed Expand file tree Collapse file tree 2 files changed +37
-7
lines changed Original file line number Diff line number Diff line change 4
4
"description" : " Cross browser Element#hidden" ,
5
5
"keywords" : [],
6
6
"author" : " Raynos <raynos2@gmail.com>" ,
7
- "repository" : " git://github.com/Colingo /hidden.git" ,
7
+ "repository" : " git://github.com/npm-dom /hidden.git" ,
8
8
"main" : " index" ,
9
- "homepage" : " https://github.com/Colingo /hidden" ,
9
+ "homepage" : " https://github.com/npm-dom /hidden" ,
10
10
"contributors" : [
11
11
{
12
12
"name" : " Raynos"
13
13
}
14
14
],
15
15
"bugs" : {
16
- "url" : " https://github.com/Colingo /hidden/issues" ,
16
+ "url" : " https://github.com/npm-dom /hidden/issues" ,
17
17
"email" : " raynos2@gmail.com"
18
18
},
19
19
"dependencies" : {},
20
20
"devDependencies" : {
21
- "tap" : " ~0.3.1" ,
22
- "browserify-server" : " ~2.1.10"
21
+ "browserify" : " 13.0.0" ,
22
+ "domify" : " 1.4.0" ,
23
+ "tape" : " 4.5.1" ,
24
+ "tape-run" : " 2.1.3"
23
25
},
24
26
"licenses" : [
25
27
{
26
28
"type" : " MIT" ,
27
- "url" : " http://github.com/Colingo /hidden/raw/master/LICENSE"
29
+ "url" : " http://github.com/npm-dom /hidden/raw/master/LICENSE"
28
30
}
29
31
],
30
32
"scripts" : {
31
- "test" : " tap ./ test"
33
+ "test" : " browserify test.js | tape-run "
32
34
}
33
35
}
Original file line number Diff line number Diff line change
1
+ var test = require ( 'tape' )
2
+ var domify = require ( 'domify' )
3
+ var hidden = require ( './' )
4
+
5
+ test ( 'Returns true/false when an element is hidden/not' , function ( t ) {
6
+ var el = domify ( '<div>eh wut wut</div>' )
7
+
8
+ t . notOk ( hidden ( el ) )
9
+
10
+ el . style . display = 'none'
11
+ t . ok ( hidden ( el ) )
12
+
13
+ t . end ( )
14
+ } )
15
+
16
+ test ( 'Sets an element\'s hiddenness' , function ( t ) {
17
+ var el = domify ( '<div>o hai</div>' )
18
+
19
+ t . notOk ( hidden ( el ) )
20
+
21
+ hidden ( el , true )
22
+ t . ok ( hidden ( el ) )
23
+
24
+ hidden ( el , false )
25
+ t . notOk ( hidden ( el ) )
26
+
27
+ t . end ( )
28
+ } )
You can’t perform that action at this time.
0 commit comments