diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-10-16 08:20:26 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-10-26 16:15:14 +0100 |
commit | d6ca446ebcfb5596b70b01d647888ce06026ba96 (patch) | |
tree | 188d3d70008fca2b1adce62f1791171d99cf14ae /settings/tests | |
parent | 145865ade0bb70ac0a24255428aea0b6dfe879e0 (diff) | |
download | nextcloud-server-d6ca446ebcfb5596b70b01d647888ce06026ba96.tar.gz nextcloud-server-d6ca446ebcfb5596b70b01d647888ce06026ba96.zip |
Adjust js unit tests
Diffstat (limited to 'settings/tests')
-rw-r--r-- | settings/tests/js/appsSpec.js | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/settings/tests/js/appsSpec.js b/settings/tests/js/appsSpec.js index 907d441ff4d..d6558746373 100644 --- a/settings/tests/js/appsSpec.js +++ b/settings/tests/js/appsSpec.js @@ -59,10 +59,10 @@ describe('OC.Settings.Apps tests', function() { beforeEach(function() { loadApps([ - {id: 'appone', name: 'App One', description: 'The first app'}, - {id: 'apptwo', name: 'App Two', description: 'The second app'}, - {id: 'appthree', name: 'App Three', description: 'Third app'}, - {id: 'somestuff', name: 'Some Stuff', description: 'whatever'} + {id: 'appone', name: 'App One', description: 'The first app', author: 'author1', level: 200}, + {id: 'apptwo', name: 'App Two', description: 'The second app', author: 'author2', level: 100}, + {id: 'appthree', name: 'App Three', description: 'Third app', author: 'author3', level: 0}, + {id: 'somestuff', name: 'Some Stuff', description: 'whatever', author: 'author4', level: 0} ]); }); @@ -97,6 +97,45 @@ describe('OC.Settings.Apps tests', function() { expect(results.length).toEqual(1); expect(results[0]).toEqual('somestuff'); }); + it('returns relevant results when query matches author name', function() { + var results; + Apps.filter('author'); + results = getResultsFromDom(); + expect(results.length).toEqual(4); + expect(results[0]).toEqual('appone'); + expect(results[1]).toEqual('apptwo'); + expect(results[2]).toEqual('appthree'); + expect(results[3]).toEqual('somestuff'); + }); + it('returns relevant result when query matches author name', function() { + var results; + Apps.filter('thor3'); + results = getResultsFromDom(); + expect(results.length).toEqual(1); + expect(results[0]).toEqual('appthree'); + }); + it('returns relevant result when query matches level name', function() { + var results; + Apps.filter('Offic'); + results = getResultsFromDom(); + expect(results.length).toEqual(1); + expect(results[0]).toEqual('appone'); + }); + it('returns relevant result when query matches level name', function() { + var results; + Apps.filter('Appro'); + results = getResultsFromDom(); + expect(results.length).toEqual(1); + expect(results[0]).toEqual('apptwo'); + }); + it('returns relevant result when query matches level name', function() { + var results; + Apps.filter('Exper'); + results = getResultsFromDom(); + expect(results.length).toEqual(2); + expect(results[0]).toEqual('appthree'); + expect(results[1]).toEqual('somestuff'); + }); }); describe('loading categories', function() { |