summaryrefslogtreecommitdiffstats
path: root/apps/files/tests/js
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-07-12 16:49:25 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-07-12 16:49:39 +0200
commitbd1929a3b18ea97bb07fbf400b2f4c3670fa44a5 (patch)
treead5e18d14def8a47311ed8de575aa81f724e36d4 /apps/files/tests/js
parentae86845062e6bf303799c8ff52fd997db6cd22ab (diff)
downloadnextcloud-server-bd1929a3b18ea97bb07fbf400b2f4c3670fa44a5.tar.gz
nextcloud-server-bd1929a3b18ea97bb07fbf400b2f4c3670fa44a5.zip
Fixed tests
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files/tests/js')
-rw-r--r--apps/files/tests/js/appSpec.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/apps/files/tests/js/appSpec.js b/apps/files/tests/js/appSpec.js
index 5728991e197..15297a029d4 100644
--- a/apps/files/tests/js/appSpec.js
+++ b/apps/files/tests/js/appSpec.js
@@ -239,38 +239,38 @@ describe('OCA.Files.App tests', function() {
expect(App.navigation.getActiveItem()).toEqual('other');
expect($('#app-content-files').hasClass('hidden')).toEqual(true);
expect($('#app-content-other').hasClass('hidden')).toEqual(false);
- expect($('li[data-id=files]').hasClass('active')).toEqual(false);
- expect($('li[data-id=other]').hasClass('active')).toEqual(true);
+ expect($('li[data-id=files] > a').hasClass('active')).toEqual(false);
+ expect($('li[data-id=other] > a').hasClass('active')).toEqual(true);
App._onPopState({view: 'files', dir: '/somedir'});
expect(App.navigation.getActiveItem()).toEqual('files');
expect($('#app-content-files').hasClass('hidden')).toEqual(false);
expect($('#app-content-other').hasClass('hidden')).toEqual(true);
- expect($('li[data-id=files]').hasClass('active')).toEqual(true);
- expect($('li[data-id=other]').hasClass('active')).toEqual(false);
+ expect($('li[data-id=files] > a').hasClass('active')).toEqual(true);
+ expect($('li[data-id=other] > a').hasClass('active')).toEqual(false);
});
it('clicking on navigation switches the panel visibility', function() {
- $('li[data-id=other]>a').click();
+ $('li[data-id=other] > a').click();
expect(App.navigation.getActiveItem()).toEqual('other');
expect($('#app-content-files').hasClass('hidden')).toEqual(true);
expect($('#app-content-other').hasClass('hidden')).toEqual(false);
- expect($('li[data-id=files]').hasClass('active')).toEqual(false);
- expect($('li[data-id=other]').hasClass('active')).toEqual(true);
+ expect($('li[data-id=files] > a').hasClass('active')).toEqual(false);
+ expect($('li[data-id=other] > a').hasClass('active')).toEqual(true);
- $('li[data-id=files]>a').click();
+ $('li[data-id=files] > a').click();
expect(App.navigation.getActiveItem()).toEqual('files');
expect($('#app-content-files').hasClass('hidden')).toEqual(false);
expect($('#app-content-other').hasClass('hidden')).toEqual(true);
- expect($('li[data-id=files]').hasClass('active')).toEqual(true);
- expect($('li[data-id=other]').hasClass('active')).toEqual(false);
+ expect($('li[data-id=files] > a').hasClass('active')).toEqual(true);
+ expect($('li[data-id=other] > a').hasClass('active')).toEqual(false);
});
it('clicking on navigation sends "show" and "urlChanged" event', function() {
var handler = sinon.stub();
var showHandler = sinon.stub();
$('#app-content-other').on('urlChanged', handler);
$('#app-content-other').on('show', showHandler);
- $('li[data-id=other]>a').click();
+ $('li[data-id=other] > a').click();
expect(handler.calledOnce).toEqual(true);
expect(handler.getCall(0).args[0].view).toEqual('other');
expect(handler.getCall(0).args[0].dir).toEqual('/');
@@ -281,7 +281,7 @@ describe('OCA.Files.App tests', function() {
var showHandler = sinon.stub();
$('#app-content-files').on('urlChanged', handler);
$('#app-content-files').on('show', showHandler);
- $('li[data-id=files]>a').click();
+ $('li[data-id=files] > a').click();
expect(handler.calledOnce).toEqual(true);
expect(handler.getCall(0).args[0].view).toEqual('files');
expect(handler.getCall(0).args[0].dir).toEqual('/');