diff options
author | Guillaume Virlet <github@virlet.org> | 2021-04-24 09:23:57 +0200 |
---|---|---|
committer | Guillaume Virlet <github@virlet.org> | 2021-04-24 09:24:52 +0200 |
commit | 910c208c4c88f95a92d61fd658488f07f76fd0cd (patch) | |
tree | 9f76673a100b21976a4bac10ae75160f1019d7ca /core/js/tests/specs | |
parent | ec38cf3b536576b790d964ac8824f1258dc3c3f7 (diff) | |
download | nextcloud-server-910c208c4c88f95a92d61fd658488f07f76fd0cd.tar.gz nextcloud-server-910c208c4c88f95a92d61fd658488f07f76fd0cd.zip |
fix broken js test
Signed-off-by: Guillaume Virlet <github@virlet.org>
Diffstat (limited to 'core/js/tests/specs')
-rw-r--r-- | core/js/tests/specs/setupchecksSpec.js | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js index a5e55a21209..79fdc12887e 100644 --- a/core/js/tests/specs/setupchecksSpec.js +++ b/core/js/tests/specs/setupchecksSpec.js @@ -990,6 +990,10 @@ describe('OC.SetupChecks tests', function() { }); }); + // THe following test is invalid as the code in core/js/setupchecks.js is calling + // window.location.protocol which always return http during tests + // if there is a way to trick window.location.protocol during test, then we could re-activate it + /* it('should return an error if the protocol is https but the server generates http links', function(done) { var async = OC.SetupChecks.checkSetup(); @@ -1043,6 +1047,57 @@ describe('OC.SetupChecks tests', function() { done(); }); }); + */ + it('should not return an error if the protocol is http and the server generates http links', function(done) { + var async = OC.SetupChecks.checkSetup(); + + suite.server.requests[0].respond( + 200, + { + 'Content-Type': 'application/json', + }, + JSON.stringify({ + hasFileinfoInstalled: true, + isGetenvServerWorking: true, + isReadOnlyConfig: false, + hasWorkingFileLocking: true, + hasValidTransactionIsolationLevel: true, + suggestedOverwriteCliURL: '', + isRandomnessSecure: true, + securityDocs: 'https://docs.nextcloud.com/myDocs.html', + serverHasInternetConnectionProblems: false, + isMemcacheConfigured: true, + forwardedForHeadersWorking: true, + isCorrectMemcachedPHPModuleInstalled: true, + hasPassedCodeIntegrityCheck: true, + isOpcacheProperlySetup: true, + hasOpcacheLoaded: true, + isSettimelimitAvailable: true, + hasFreeTypeSupport: true, + missingIndexes: [], + missingPrimaryKeys: [], + missingColumns: [], + cronErrors: [], + cronInfo: { + diffInSeconds: 0 + }, + isMemoryLimitSufficient: true, + appDirsWithDifferentOwner: [], + recommendedPHPModules: [], + pendingBigIntConversionColumns: [], + isMysqlUsedWithoutUTF8MB4: false, + isDefaultPhoneRegionSet: true, + isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, + reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html', + reverseProxyGeneratedURL: 'http://server', + }) + ); + + async.done(function( data, s, x ){ + expect(data).toEqual([]); + done(); + }); + }); it('should return an error if there is not enough free space in the temp directory', function(done) { var async = OC.SetupChecks.checkSetup(); |