Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Commit

Permalink
test(booleanFilter): Added more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianlee44 committed Feb 15, 2015
1 parent 4ee1113 commit 7ddbd99
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 14 deletions.
14 changes: 0 additions & 14 deletions test/unit/filters.boolean.spec.coffee

This file was deleted.

66 changes: 66 additions & 0 deletions test/unit/filters.boolean.spec.js
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');
});
});

0 comments on commit 7ddbd99

Please sign in to comment.