This repository has been archived by the owner on May 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(booleanFilter): Added more tests
- Loading branch information
1 parent
4ee1113
commit 7ddbd99
Showing
2 changed files
with
66 additions
and
14 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
describe('Filter: boolean', function() { | ||
var booleanFilter; | ||
|
||
beforeEach(module('Mac')); | ||
beforeEach(inject(function($filter){ | ||
booleanFilter = $filter('boolean'); | ||
})); | ||
|
||
it('should return true string', function() { | ||
expect(booleanFilter(true, 'show this', 'not this'), 'show this'); | ||
}); | ||
|
||
it('should return false string', function() { | ||
expect(booleanFilter(false, 'nop', 'but this'), 'but this'); | ||
}); | ||
|
||
it('should return default true string', function() { | ||
expect(booleanFilter(true), 'true'); | ||
}); | ||
|
||
it('should return default false string', function() { | ||
expect(booleanFilter(false), 'false'); | ||
}); | ||
}); | ||
|
||
describe('Filter: true', function() { | ||
var trueFilter; | ||
|
||
beforeEach(module('Mac')); | ||
beforeEach(inject(function($filter) { | ||
trueFilter = $filter('true'); | ||
})); | ||
|
||
it('should return true string', function() { | ||
expect(trueFilter(true, 'show this'), 'show this'); | ||
}); | ||
|
||
it('should return empty string', function() { | ||
expect(trueFilter(false, 'nop'), ''); | ||
}); | ||
|
||
it('should return default true text', function() { | ||
expect(trueFilter(true), 'true'); | ||
}); | ||
}); | ||
|
||
describe('Filter: false', function() { | ||
var falseFilter; | ||
|
||
beforeEach(module('Mac')); | ||
beforeEach(inject(function($filter) { | ||
falseFilter = $filter('false'); | ||
})); | ||
|
||
it('should return false string', function() { | ||
expect(falseFilter(false, 'show this'), 'show this'); | ||
}); | ||
|
||
it('should return empty string', function() { | ||
expect(falseFilter(true, 'nop'), ''); | ||
}); | ||
|
||
it('should return default true text', function() { | ||
expect(falseFilter(false), 'false'); | ||
}); | ||
}); |