summaryrefslogtreecommitdiffstats
path: root/core/js/tests/specs/setupchecksSpec.js
diff options
context:
space:
mode:
authorJan-Christoph Borchardt <hey@jancborchardt.net>2015-08-18 13:38:08 +0200
committerJan-Christoph Borchardt <hey@jancborchardt.net>2015-08-18 13:38:08 +0200
commit12eec397e321feb1e35712627b77d9f9db42015e (patch)
treecbbbe11070df746f7e176cdd2f2dfe33cbcdb072 /core/js/tests/specs/setupchecksSpec.js
parentffff156965beaf52a22a024e240bf56a9f8d2b44 (diff)
parent01607c09b841e9c18d551e4a5c8207114dde62be (diff)
downloadnextcloud-server-12eec397e321feb1e35712627b77d9f9db42015e.tar.gz
nextcloud-server-12eec397e321feb1e35712627b77d9f9db42015e.zip
Merge pull request #17975 from owncloud/settings_admin_warning_levels
Settings admin warning levels
Diffstat (limited to 'core/js/tests/specs/setupchecksSpec.js')
-rw-r--r--core/js/tests/specs/setupchecksSpec.js111
1 files changed, 97 insertions, 14 deletions
diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js
index d0efcf4b284..45ccebe849c 100644
--- a/core/js/tests/specs/setupchecksSpec.js
+++ b/core/js/tests/specs/setupchecksSpec.js
@@ -29,7 +29,10 @@ describe('OC.SetupChecks tests', function() {
suite.server.requests[0].respond(200);
async.done(function( data, s, x ){
- expect(data).toEqual(['Your web server is not yet set up properly to allow file synchronization because the WebDAV interface seems to be broken.']);
+ expect(data).toEqual([{
+ msg: 'Your web server is not yet set up properly to allow file synchronization because the WebDAV interface seems to be broken.',
+ type: OC.SetupChecks.MESSAGE_TYPE_ERROR
+ }]);
done();
});
});
@@ -75,7 +78,17 @@ describe('OC.SetupChecks tests', function() {
);
async.done(function( data, s, x ){
- expect(data).toEqual(['This server has no working Internet connection. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. We suggest to enable Internet connection for this server if you want to have all features.', 'Your data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root.', 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a href="https://doc.owncloud.org/server/go.php?to=admin-performance">documentation</a>.']);
+ expect(data).toEqual([
+ {
+ msg: 'This server has no working Internet connection. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. We suggest to enable Internet connection for this server if you want to have all features.',
+ type: OC.SetupChecks.MESSAGE_TYPE_WARNING
+ }, {
+ msg: 'Your data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root.',
+ type: OC.SetupChecks.MESSAGE_TYPE_ERROR
+ }, {
+ msg: 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a href="https://doc.owncloud.org/server/go.php?to=admin-performance">documentation</a>.',
+ type: OC.SetupChecks.MESSAGE_TYPE_INFO
+ }]);
done();
});
});
@@ -98,7 +111,19 @@ describe('OC.SetupChecks tests', function() {
);
async.done(function( data, s, x ){
- expect(data).toEqual(['This server has no working Internet connection. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. We suggest to enable Internet connection for this server if you want to have all features.', 'Your data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root.', 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a href="https://doc.owncloud.org/server/go.php?to=admin-performance">documentation</a>.']);
+ expect(data).toEqual([
+ {
+ msg: 'This server has no working Internet connection. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. We suggest to enable Internet connection for this server if you want to have all features.',
+ type: OC.SetupChecks.MESSAGE_TYPE_WARNING
+ },
+ {
+ msg: 'Your data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root.',
+ type: OC.SetupChecks.MESSAGE_TYPE_ERROR
+ },
+ {
+ msg: 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a href="https://doc.owncloud.org/server/go.php?to=admin-performance">documentation</a>.',
+ type: OC.SetupChecks.MESSAGE_TYPE_INFO
+ }]);
done();
});
});
@@ -121,7 +146,15 @@ describe('OC.SetupChecks tests', function() {
);
async.done(function( data, s, x ){
- expect(data).toEqual(['This server has no working Internet connection. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. We suggest to enable Internet connection for this server if you want to have all features.', 'Your data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root.']);
+ expect(data).toEqual([
+ {
+ msg: 'This server has no working Internet connection. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. We suggest to enable Internet connection for this server if you want to have all features.',
+ type: OC.SetupChecks.MESSAGE_TYPE_WARNING
+ },
+ {
+ msg: 'Your data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root.',
+ type: OC.SetupChecks.MESSAGE_TYPE_ERROR
+ }]);
done();
});
});
@@ -145,7 +178,10 @@ describe('OC.SetupChecks tests', function() {
);
async.done(function( data, s, x ){
- expect(data).toEqual(['/dev/urandom is not readable by PHP which is highly discouraged for security reasons. Further information can be found in our <a href="https://docs.owncloud.org/myDocs.html">documentation</a>.']);
+ expect(data).toEqual([{
+ msg: '/dev/urandom is not readable by PHP which is highly discouraged for security reasons. Further information can be found in our <a href="https://docs.owncloud.org/myDocs.html">documentation</a>.',
+ type: OC.SetupChecks.MESSAGE_TYPE_WARNING
+ }]);
done();
});
});
@@ -186,7 +222,10 @@ describe('OC.SetupChecks tests', function() {
);
async.done(function( data, s, x ){
- expect(data).toEqual(['Error occurred while checking server setup']);
+ expect(data).toEqual([{
+ msg: 'Error occurred while checking server setup',
+ type: OC.SetupChecks.MESSAGE_TYPE_ERROR
+ }]);
done();
});
});
@@ -229,7 +268,13 @@ describe('OC.SetupChecks tests', function() {
);
async.done(function( data, s, x ){
- expect(data).toEqual(['Error occurred while checking server setup', 'Error occurred while checking server setup']);
+ expect(data).toEqual([{
+ msg: 'Error occurred while checking server setup',
+ type: OC.SetupChecks.MESSAGE_TYPE_ERROR
+ },{
+ msg: 'Error occurred while checking server setup',
+ type: OC.SetupChecks.MESSAGE_TYPE_ERROR
+ }]);
done();
});
});
@@ -247,7 +292,21 @@ describe('OC.SetupChecks tests', function() {
);
async.done(function( data, s, x ){
- expect(data).toEqual(['The "X-XSS-Protection" HTTP header is not configured to equal to "1; mode=block". This is a potential security or privacy risk and we recommend adjusting this setting.', 'The "X-Content-Type-Options" HTTP header is not configured to equal to "nosniff". This is a potential security or privacy risk and we recommend adjusting this setting.', 'The "X-Robots-Tag" HTTP header is not configured to equal to "none". This is a potential security or privacy risk and we recommend adjusting this setting.', 'The "X-Frame-Options" HTTP header is not configured to equal to "SAMEORIGIN". This is a potential security or privacy risk and we recommend adjusting this setting.']);
+ expect(data).toEqual([
+ {
+ msg: 'The "X-XSS-Protection" HTTP header is not configured to equal to "1; mode=block". This is a potential security or privacy risk and we recommend adjusting this setting.',
+ type: OC.SetupChecks.MESSAGE_TYPE_WARNING
+ }, {
+ msg: 'The "X-Content-Type-Options" HTTP header is not configured to equal to "nosniff". This is a potential security or privacy risk and we recommend adjusting this setting.',
+ type: OC.SetupChecks.MESSAGE_TYPE_WARNING
+ }, {
+ msg: 'The "X-Robots-Tag" HTTP header is not configured to equal to "none". This is a potential security or privacy risk and we recommend adjusting this setting.',
+ type: OC.SetupChecks.MESSAGE_TYPE_WARNING
+
+ }, {
+ msg: 'The "X-Frame-Options" HTTP header is not configured to equal to "SAMEORIGIN". This is a potential security or privacy risk and we recommend adjusting this setting.',
+ type: OC.SetupChecks.MESSAGE_TYPE_WARNING
+ }]);
done();
});
});
@@ -266,7 +325,13 @@ describe('OC.SetupChecks tests', function() {
);
async.done(function( data, s, x ){
- expect(data).toEqual(['The "X-XSS-Protection" HTTP header is not configured to equal to "1; mode=block". This is a potential security or privacy risk and we recommend adjusting this setting.', 'The "X-Content-Type-Options" HTTP header is not configured to equal to "nosniff". This is a potential security or privacy risk and we recommend adjusting this setting.']);
+ expect(data).toEqual([{
+ msg: 'The "X-XSS-Protection" HTTP header is not configured to equal to "1; mode=block". This is a potential security or privacy risk and we recommend adjusting this setting.',
+ type: OC.SetupChecks.MESSAGE_TYPE_WARNING,
+ }, {
+ msg: 'The "X-Content-Type-Options" HTTP header is not configured to equal to "nosniff". This is a potential security or privacy risk and we recommend adjusting this setting.',
+ type: OC.SetupChecks.MESSAGE_TYPE_WARNING
+ }]);
done();
});
});
@@ -307,7 +372,10 @@ describe('OC.SetupChecks tests', function() {
);
async.done(function( data, s, x ){
- expect(data).toEqual(['You are accessing this site via HTTP. We strongly suggest you configure your server to require using HTTPS instead as described in our <a href="#admin-tips">security tips</a>.']);
+ expect(data).toEqual([{
+ msg: 'You are accessing this site via HTTP. We strongly suggest you configure your server to require using HTTPS instead as described in our <a href="#admin-tips">security tips</a>.',
+ type: OC.SetupChecks.MESSAGE_TYPE_WARNING
+ }]);
done();
});
});
@@ -323,7 +391,13 @@ describe('OC.SetupChecks tests', function() {
JSON.stringify({data: {serverHasInternetConnection: false, dataDirectoryProtected: false}})
);
async.done(function( data, s, x ){
- expect(data).toEqual(['Error occurred while checking server setup', 'Error occurred while checking server setup']);
+ expect(data).toEqual([{
+ msg: 'Error occurred while checking server setup',
+ type: OC.SetupChecks.MESSAGE_TYPE_ERROR
+ }, {
+ msg: 'Error occurred while checking server setup',
+ type: OC.SetupChecks.MESSAGE_TYPE_ERROR
+ }]);
done();
});
});
@@ -342,7 +416,10 @@ describe('OC.SetupChecks tests', function() {
);
async.done(function( data, s, x ){
- expect(data).toEqual(['The "Strict-Transport-Security" HTTP header is not configured to least "15768000" seconds. For enhanced security we recommend enabling HSTS as described in our <a href="#admin-tips">security tips</a>.']);
+ expect(data).toEqual([{
+ msg: 'The "Strict-Transport-Security" HTTP header is not configured to least "15768000" seconds. For enhanced security we recommend enabling HSTS as described in our <a href="#admin-tips">security tips</a>.',
+ type: OC.SetupChecks.MESSAGE_TYPE_WARNING
+ }]);
done();
});
});
@@ -362,7 +439,10 @@ describe('OC.SetupChecks tests', function() {
);
async.done(function( data, s, x ){
- expect(data).toEqual(['The "Strict-Transport-Security" HTTP header is not configured to least "15768000" seconds. For enhanced security we recommend enabling HSTS as described in our <a href="#admin-tips">security tips</a>.']);
+ expect(data).toEqual([{
+ msg: 'The "Strict-Transport-Security" HTTP header is not configured to least "15768000" seconds. For enhanced security we recommend enabling HSTS as described in our <a href="#admin-tips">security tips</a>.',
+ type: OC.SetupChecks.MESSAGE_TYPE_WARNING
+ }]);
done();
});
});
@@ -382,7 +462,10 @@ describe('OC.SetupChecks tests', function() {
);
async.done(function( data, s, x ){
- expect(data).toEqual(['The "Strict-Transport-Security" HTTP header is not configured to least "15768000" seconds. For enhanced security we recommend enabling HSTS as described in our <a href="#admin-tips">security tips</a>.']);
+ expect(data).toEqual([{
+ msg: 'The "Strict-Transport-Security" HTTP header is not configured to least "15768000" seconds. For enhanced security we recommend enabling HSTS as described in our <a href="#admin-tips">security tips</a>.',
+ type: OC.SetupChecks.MESSAGE_TYPE_WARNING
+ }]);
done();
});
});