mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
Merge branch 'chat_match_users' into autocomplete_unit_tests
This commit is contained in:
@@ -137,23 +137,28 @@ describe("Autocomplete controller", function() {
|
||||
})
|
||||
|
||||
describe("filterUser", function() {
|
||||
it('filters with undefined query (not loaded yet) and defaults to true', function() {
|
||||
expect(scope.filterUser({user: "boo"})).to.be.eq(true);
|
||||
it('filters with undefined query (not loaded yet) and returns false (so it will not be rendered)', function() {
|
||||
expect(scope.filterUser({user: "boo"})).to.be.eq(false);
|
||||
})
|
||||
|
||||
it('filters with null query (no typing yet) and defaults to true', function() {
|
||||
it('filters with null query (no typing yet) and returns false (so it will not be rendered)', function() {
|
||||
scope.query = null
|
||||
expect(scope.filterUser({user: "boo"})).to.be.ok
|
||||
expect(scope.filterUser({user: "boo"})).to.be.eq(false);
|
||||
})
|
||||
|
||||
it('filters with empty prefix and returns true', function() {
|
||||
scope.query = {text: ""}
|
||||
expect(scope.filterUser({user: "prefix"})).to.be.eq(true);
|
||||
})
|
||||
|
||||
it('filters with prefix element and returns true', function() {
|
||||
scope.query = {text: "pre"}
|
||||
expect(scope.filterUser({user: "prefix"})).to.be.ok
|
||||
expect(scope.filterUser({user: "prefix"})).to.be.eq(true);
|
||||
})
|
||||
|
||||
it('filters with nonprefix element and returns false', function() {
|
||||
scope.query = {text: "noprefix"}
|
||||
expect(scope.filterUser({user: "prefix"})).to.not.be.ok
|
||||
expect(scope.filterUser({user: "prefix"})).to.be.eq(false);
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user