Cleaned up location of test files

This commit is contained in:
Blade Barringer
2015-06-13 21:11:43 -05:00
parent 2134465a75
commit 3457068351
2 changed files with 0 additions and 54 deletions

View File

@@ -1,54 +0,0 @@
'use strict';
describe('Custom Filters', function() {
var filter
, orderBySpy = sinon.spy();
beforeEach(function() {
module(function($provide) {
$provide.value('orderByFilter', orderBySpy);
});
inject(function($rootScope, $filter) {
filter = $filter;
});
});
describe('conditionalOrderBy', function() {
describe('when the predicate is true', function() {
it('delegates the arguments to the orderBy filter', function() {
filter('conditionalOrderBy')('array', true, 'sortPredicate', 'reverseOrder');
expect(orderBySpy).to.have.been.calledWith('array','sortPredicate','reverseOrder');
});
});
describe('when the predicate is false', function() {
it('returns the initial array', function() {
expect(filter('conditionalOrderBy')([1,2,3], false)).to.eql([1,2,3]);
});
});
});
describe('filterByTextAndNotes', function () {
it('returns undefined when no input given', function () {
expect(filter('filterByTextAndNotes')()).to.eql(undefined);
});
it('returns input if term is not a string', function () {
var input = [1, 2, 3];
expect(filter('filterByTextAndNotes')(input, '')).to.eql(input);
expect(filter('filterByTextAndNotes')(input, undefined)).to.eql(input);
expect(filter('filterByTextAndNotes')(input, [])).to.eql(input);
expect(filter('filterByTextAndNotes')(input, new Date())).to.eql(input);
});
it('filters items by notes and text', function () {
var tasks = [
{ text: 'foo' },
{ text: 'foo', notes: 'bar' }
];
expect(filter('filterByTextAndNotes')(tasks, 'bar')).to.eql([tasks[1]]);
expect(filter('filterByTextAndNotes')(tasks, 'foo')).to.eql([tasks[0], tasks[1]]);
});
});
});