File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11const test = require ( 'ava' ) ;
2+ const authIsDisabled = require ( '../src/authIsDisabled' ) ;
23
34test . todo ( 'Create tests for authIsDisabled' ) ;
5+ test ( 'works with no options' , ( t ) => {
6+ t . false ( authIsDisabled ( ) , 'should handle undefined input' ) ;
7+ t . false ( authIsDisabled ( false ) , 'should handle false input' ) ;
8+ t . false ( authIsDisabled ( '' ) , 'should handle empty string input' ) ;
9+ t . false ( authIsDisabled ( { } ) , 'should handle empty object input' ) ;
10+ } ) ;
11+
12+ test ( 'handles authLevel correctly' , ( t ) => {
13+ t . true ( authIsDisabled ( { authLevel : false } ) , 'false AuthLevel should disable authorization' ) ;
14+ t . false ( authIsDisabled ( { authLevel : 0 } ) , 'authLevel of 0 should not disable authorization' ) ;
15+ t . false (
16+ authIsDisabled ( { authLevel : '' } ) ,
17+ 'authLevel of empty string should not disable authorization' ,
18+ ) ;
19+ } ) ;
Original file line number Diff line number Diff line change @@ -224,10 +224,6 @@ module.exports = {
224224 ) ;
225225 test . done ( ) ;
226226 } ,
227- authIsDisabled ( test ) {
228- // TODO fill in
229- test . done ( ) ;
230- } ,
231227 embedPermissions ( test ) {
232228 // TODO fill in
233229 test . done ( ) ;
You can’t perform that action at this time.
0 commit comments