Skip to content

Commit

Permalink
fix: js tests for jasmine 5.x.x
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepDiver1975 authored and phil-davis committed Feb 13, 2024
1 parent cfee958 commit c1b1f4f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 53 deletions.
1 change: 1 addition & 0 deletions apps/files/tests/js/favoritespluginspec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe('OCA.Files.FavoritesPlugin tests', function() {
'</div>' +
'</div>'
);
OCA.Files.App.initialize();
OC.Plugins.attach('OCA.Files.App', Plugin);
fileList = Plugin.showFileList($('#app-content-favorites'));
});
Expand Down
15 changes: 0 additions & 15 deletions apps/files_external/tests/js/settingsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,15 +308,6 @@ describe('OCA.External.Settings tests', function() {
expect(storage.validate()).toBe(false);
});
});
describe('update storage', function() {
// TODO
});
describe('delete storage', function() {
// TODO
});
describe('recheck storages', function() {
// TODO
});
describe('mount options dropdown', function() {
var $tr;
var $td;
Expand Down Expand Up @@ -414,12 +405,6 @@ describe('OCA.External.Settings tests', function() {
});
});
});
describe('applicable user list', function() {
// TODO: test select2 retrieval logic
});
describe('allow user mounts section', function() {
// TODO: test allowUserMounting section
});

describe('mountConfigLoaded event is triggered', function() {
var view;
Expand Down
4 changes: 0 additions & 4 deletions apps/files_sharing/tests/js/shareSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ describe('OCA.Sharing.Util tests', function() {
fileList.destroy();
fileList = null;
});

describe('Sharing data in table row', function() {
// TODO: test data-permissions, data-share-owner, etc
});
describe('Share action icon', function() {
it('do not shows share text when not shared', function() {
var $action, $tr;
Expand Down
23 changes: 0 additions & 23 deletions apps/files_trashbin/tests/js/filelistSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,29 +211,6 @@ describe('OCA.Trashbin.FileList tests', function() {
expect(fileList.$el.find('tbody tr .filesize').length).toEqual(0);
});
});
describe('File actions', function() {
describe('Deleting single files', function() {
// TODO: checks ajax call
// TODO: checks spinner
// TODO: remove item after delete
// TODO: bring back item if delete failed
});
describe('Restoring single files', function() {
// TODO: checks ajax call
// TODO: checks spinner
// TODO: remove item after restore
// TODO: bring back item if restore failed
});
});
describe('file previews', function() {
// TODO: check that preview URL is going through files_trashbin
});
describe('loading file list', function() {
// TODO: check that ajax URL is going through files_trashbin
});
describe('breadcrumbs', function() {
// TODO: test label + URL
});
describe('elementToFile', function() {
var $tr;

Expand Down
4 changes: 3 additions & 1 deletion core/js/tests/specHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ window.oc_config = {
blacklist_files_regex: '\.(part|filepart)$'
};
window.oc_appconfig = {
core: {}
core: {},
files: {},
files_sharing: {}
};
window.oc_defaults = {};
window.oc_requesttoken = 'testrequesttoken';
Expand Down
21 changes: 11 additions & 10 deletions core/js/tests/specs/setupchecksSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ describe('OC.SetupChecks tests', function() {
oc_dataURL = "data";

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

suite.server.requests[0].respond(200, {'Content-Type': 'text/plain'}, '*cough*HTACCESSFAIL*cough*');
suite.server.respond();

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

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

suite.server.requests[0].respond(403);
suite.server.respond();

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

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

suite.server.requests[0].respond(200, {'Content-Type': 'text/plain'}, '<html><body>blah</body></html>');
suite.server.respond();

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

describe('checkSetup', function() {
it('should return an error if server has no internet connection', function(done) {
var async = OC.SetupChecks.checkSetup();

suite.server.requests[0].respond(
suite.server.respondWith([
200,
{
'Content-Type': 'application/json'
Expand All @@ -168,7 +166,10 @@ describe('OC.SetupChecks tests', function() {
isCorrectMemcachedPHPModuleInstalled: true,
hasPassedCodeIntegrityCheck: true,
})
);
]);
var async = OC.SetupChecks.checkSetup();
suite.server.respond();


async.done(function( data, s, x ){
expect(data).toEqual([
Expand Down

0 comments on commit c1b1f4f

Please sign in to comment.