summaryrefslogtreecommitdiffstats
path: root/settings/tests
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-10-16 08:32:37 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2015-10-26 16:15:15 +0100
commitf3a77c7d997056fd166d500a7c855288e4adf163 (patch)
tree98dc9d67e15ee8ee84860e212b4fa515be29a2a8 /settings/tests
parentd6ca446ebcfb5596b70b01d647888ce06026ba96 (diff)
downloadnextcloud-server-f3a77c7d997056fd166d500a7c855288e4adf163.tar.gz
nextcloud-server-f3a77c7d997056fd166d500a7c855288e4adf163.zip
Add js tests for empty content page
Diffstat (limited to 'settings/tests')
-rw-r--r--settings/tests/js/appsSpec.js23
1 files changed, 19 insertions, 4 deletions
diff --git a/settings/tests/js/appsSpec.js b/settings/tests/js/appsSpec.js
index d6558746373..d2ca1fb5c8b 100644
--- a/settings/tests/js/appsSpec.js
+++ b/settings/tests/js/appsSpec.js
@@ -24,6 +24,7 @@ describe('OC.Settings.Apps tests', function() {
beforeEach(function() {
var $el = $('<div id="apps-list"></div>' +
+ '<div id="apps-list-empty" class="hidden"></div>' +
'<div id="app-template">' +
// dummy template for testing
'<div id="app-{{id}}" data-id="{{id}}" class="section">{{name}}</div>' +
@@ -66,15 +67,26 @@ describe('OC.Settings.Apps tests', function() {
]);
});
- it('does not filter when no query passed', function() {
- Apps.filter('');
- expect(getResultsFromDom().length).toEqual(4);
- });
it('returns no results when query does not match anything', function() {
+ expect(getResultsFromDom().length).toEqual(4);
+ expect($('#apps-list:not(.hidden)').length).toEqual(1);
+ expect($('#apps-list-empty:not(.hidden)').length).toEqual(0);
+
Apps.filter('absurdity');
expect(getResultsFromDom().length).toEqual(0);
+ expect($('#apps-list:not(.hidden)').length).toEqual(0);
+ expect($('#apps-list-empty:not(.hidden)').length).toEqual(1);
+
+ Apps.filter('');
+ expect(getResultsFromDom().length).toEqual(4);
+ expect($('#apps-list:not(.hidden)').length).toEqual(1);
+ expect($('#apps-list-empty:not(.hidden)').length).toEqual(0);
+ expect(getResultsFromDom().length).toEqual(4);
});
it('returns relevant results when query matches name', function() {
+ expect($('#apps-list:not(.hidden)').length).toEqual(1);
+ expect($('#apps-list-empty:not(.hidden)').length).toEqual(0);
+
var results;
Apps.filter('app');
results = getResultsFromDom();
@@ -82,6 +94,9 @@ describe('OC.Settings.Apps tests', function() {
expect(results[0]).toEqual('appone');
expect(results[1]).toEqual('apptwo');
expect(results[2]).toEqual('appthree');
+
+ expect($('#apps-list:not(.hidden)').length).toEqual(1);
+ expect($('#apps-list-empty:not(.hidden)').length).toEqual(0);
});
it('returns relevant result when query matches name', function() {
var results;