Skip to content

Commit 68df459

Browse files
DeepDiver1975phil-davis
authored andcommitted
fix: js tests for jasmine 5.x.x
1 parent e1b5a28 commit 68df459

File tree

6 files changed

+15
-53
lines changed

6 files changed

+15
-53
lines changed

apps/files/tests/js/favoritespluginspec.js

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ describe('OCA.Files.FavoritesPlugin tests', function() {
2727
'</div>' +
2828
'</div>'
2929
);
30+
OCA.Files.App.initialize();
3031
OC.Plugins.attach('OCA.Files.App', Plugin);
3132
fileList = Plugin.showFileList($('#app-content-favorites'));
3233
});

apps/files_external/tests/js/settingsSpec.js

-15
Original file line numberDiff line numberDiff line change
@@ -308,15 +308,6 @@ describe('OCA.External.Settings tests', function() {
308308
expect(storage.validate()).toBe(false);
309309
});
310310
});
311-
describe('update storage', function() {
312-
// TODO
313-
});
314-
describe('delete storage', function() {
315-
// TODO
316-
});
317-
describe('recheck storages', function() {
318-
// TODO
319-
});
320311
describe('mount options dropdown', function() {
321312
var $tr;
322313
var $td;
@@ -414,12 +405,6 @@ describe('OCA.External.Settings tests', function() {
414405
});
415406
});
416407
});
417-
describe('applicable user list', function() {
418-
// TODO: test select2 retrieval logic
419-
});
420-
describe('allow user mounts section', function() {
421-
// TODO: test allowUserMounting section
422-
});
423408

424409
describe('mountConfigLoaded event is triggered', function() {
425410
var view;

apps/files_sharing/tests/js/shareSpec.js

-4
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@ describe('OCA.Sharing.Util tests', function() {
7272
fileList.destroy();
7373
fileList = null;
7474
});
75-
76-
describe('Sharing data in table row', function() {
77-
// TODO: test data-permissions, data-share-owner, etc
78-
});
7975
describe('Share action icon', function() {
8076
it('do not shows share text when not shared', function() {
8177
var $action, $tr;

apps/files_trashbin/tests/js/filelistSpec.js

-23
Original file line numberDiff line numberDiff line change
@@ -211,29 +211,6 @@ describe('OCA.Trashbin.FileList tests', function() {
211211
expect(fileList.$el.find('tbody tr .filesize').length).toEqual(0);
212212
});
213213
});
214-
describe('File actions', function() {
215-
describe('Deleting single files', function() {
216-
// TODO: checks ajax call
217-
// TODO: checks spinner
218-
// TODO: remove item after delete
219-
// TODO: bring back item if delete failed
220-
});
221-
describe('Restoring single files', function() {
222-
// TODO: checks ajax call
223-
// TODO: checks spinner
224-
// TODO: remove item after restore
225-
// TODO: bring back item if restore failed
226-
});
227-
});
228-
describe('file previews', function() {
229-
// TODO: check that preview URL is going through files_trashbin
230-
});
231-
describe('loading file list', function() {
232-
// TODO: check that ajax URL is going through files_trashbin
233-
});
234-
describe('breadcrumbs', function() {
235-
// TODO: test label + URL
236-
});
237214
describe('elementToFile', function() {
238215
var $tr;
239216

core/js/tests/specHelper.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ window.oc_config = {
9797
blacklist_files_regex: '\.(part|filepart)$'
9898
};
9999
window.oc_appconfig = {
100-
core: {}
100+
core: {},
101+
files: {},
102+
files_sharing: {}
101103
};
102104
window.oc_defaults = {};
103105
window.oc_requesttoken = 'testrequesttoken';

core/js/tests/specs/setupchecksSpec.js

+11-10
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ describe('OC.SetupChecks tests', function() {
101101
oc_dataURL = "data";
102102

103103
it('should return an error if data directory is not protected', function(done) {
104+
suite.server.respondWith([ 200, { "Content-Type": "text/plain" }, '*cough*HTACCESSFAIL*cough*']);
104105
var async = OC.SetupChecks.checkDataProtected();
105-
106-
suite.server.requests[0].respond(200, {'Content-Type': 'text/plain'}, '*cough*HTACCESSFAIL*cough*');
106+
suite.server.respond();
107107

108108
async.done(function( data, s, x ){
109109
expect(data).toEqual([
@@ -116,9 +116,9 @@ describe('OC.SetupChecks tests', function() {
116116
});
117117

118118
it('should not return an error if data directory is protected', function(done) {
119+
suite.server.respondWith([ 403, { "Content-Type": "text/plain" }, '403']);
119120
var async = OC.SetupChecks.checkDataProtected();
120-
121-
suite.server.requests[0].respond(403);
121+
suite.server.respond();
122122

123123
async.done(function( data, s, x ){
124124
expect(data).toEqual([]);
@@ -127,9 +127,9 @@ describe('OC.SetupChecks tests', function() {
127127
});
128128

129129
it('should not return an error if data directory is protected and redirects to main page', function(done) {
130+
suite.server.respondWith([200, {'Content-Type': 'text/plain'}, '<html><body>blah</body></html>']);
130131
var async = OC.SetupChecks.checkDataProtected();
131-
132-
suite.server.requests[0].respond(200, {'Content-Type': 'text/plain'}, '<html><body>blah</body></html>');
132+
suite.server.respond();
133133

134134
async.done(function( data, s, x ){
135135
expect(data).toEqual([]);
@@ -153,9 +153,7 @@ describe('OC.SetupChecks tests', function() {
153153

154154
describe('checkSetup', function() {
155155
it('should return an error if server has no internet connection', function(done) {
156-
var async = OC.SetupChecks.checkSetup();
157-
158-
suite.server.requests[0].respond(
156+
suite.server.respondWith([
159157
200,
160158
{
161159
'Content-Type': 'application/json'
@@ -168,7 +166,10 @@ describe('OC.SetupChecks tests', function() {
168166
isCorrectMemcachedPHPModuleInstalled: true,
169167
hasPassedCodeIntegrityCheck: true,
170168
})
171-
);
169+
]);
170+
var async = OC.SetupChecks.checkSetup();
171+
suite.server.respond();
172+
172173

173174
async.done(function( data, s, x ){
174175
expect(data).toEqual([

0 commit comments

Comments
 (0)