aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/tests/js/filesummarySpec.js
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2022-12-28 19:08:54 +0100
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-01-04 16:46:16 +0100
commit0a3ef8b74bffc9b1cb6ef21695037d52aabd3ee1 (patch)
tree673c1fa994320800bfceb33eb45299137c15488d /apps/files/tests/js/filesummarySpec.js
parent5b9a8f0407a9e3fe7e00f0fc9284ea986905f1b5 (diff)
downloadnextcloud-server-0a3ef8b74bffc9b1cb6ef21695037d52aabd3ee1.tar.gz
nextcloud-server-0a3ef8b74bffc9b1cb6ef21695037d52aabd3ee1.zip
Fixing tests
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files/tests/js/filesummarySpec.js')
-rw-r--r--apps/files/tests/js/filesummarySpec.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/files/tests/js/filesummarySpec.js b/apps/files/tests/js/filesummarySpec.js
index 8692b8b14aa..8bc7bd8f995 100644
--- a/apps/files/tests/js/filesummarySpec.js
+++ b/apps/files/tests/js/filesummarySpec.js
@@ -204,7 +204,8 @@ describe('OCA.Files.FileSummary tests', function() {
});
it('renders hidden count section when hidden files are hidden', function() {
- config.set('showhidden', false);
+ window._nc_event_bus.emit('files:config:updated', { key: 'show_hidden', value: false });
+
summary.add({name: 'abc', type: 'file', size: 256000});
summary.add({name: 'def', type: 'dir', size: 100});
summary.add({name: '.hidden', type: 'dir', size: 512000});
@@ -217,7 +218,8 @@ describe('OCA.Files.FileSummary tests', function() {
expect($container.find('.filesize').text()).toEqual('750 KB');
});
it('does not render hidden count section when hidden files exist but are visible', function() {
- config.set('showhidden', true);
+ window._nc_event_bus.emit('files:config:updated', { key: 'show_hidden', value: true });
+
summary.add({name: 'abc', type: 'file', size: 256000});
summary.add({name: 'def', type: 'dir', size: 100});
summary.add({name: '.hidden', type: 'dir', size: 512000});
@@ -229,7 +231,8 @@ describe('OCA.Files.FileSummary tests', function() {
expect($container.find('.filesize').text()).toEqual('750 KB');
});
it('does not render hidden count section when no hidden files exist', function() {
- config.set('showhidden', false);
+ window._nc_event_bus.emit('files:config:updated', { key: 'show_hidden', value: false });
+
summary.add({name: 'abc', type: 'file', size: 256000});
summary.add({name: 'def', type: 'dir', size: 100});
summary.update();