Girish Ramakrishnan преди 7 години
родител
ревизия
72d3757c51
променени са 3 файла, в които са добавени 13 реда и са изтрити 3 реда
  1. 1 1
      CloudronManifest.json
  2. 2 2
      test/package.json
  3. 10 0
      test/test.js

+ 1 - 1
CloudronManifest.json

@@ -5,7 +5,7 @@
   "description": "file://DESCRIPTION.md",
   "changelog": "file://CHANGELOG",
   "tagline": "Decentralized file synchronization",
-  "version": "1.0.0",
+  "version": "1.0.0-1",
   "healthCheckPath": "/healthcheck",
   "httpPort": 8000,
   "addons": {

+ 2 - 2
test/package.json

@@ -9,6 +9,7 @@
   "author": "",
   "license": "ISC",
   "dependencies": {
+    "chromedriver": "^2.31.0",
     "ejs": "^2.4.2",
     "expect.js": "^0.3.1",
     "mkdirp": "^0.5.1",
@@ -16,7 +17,6 @@
     "rimraf": "^2.5.3",
     "selenium-server-standalone-jar": "^2.53.1",
     "selenium-webdriver": "^2.53.1",
-    "superagent": "^1.4.0",
-    "chromedriver": "^2.31.0"
+    "superagent": "^1.8.5"
   }
 }

+ 10 - 0
test/test.js

@@ -4,6 +4,7 @@
 
 var execSync = require('child_process').execSync,
     expect = require('expect.js'),
+    superagent = require('superagent'),
     path = require('path'),
     webdriver = require('selenium-webdriver');
 
@@ -61,6 +62,14 @@ describe('Application life cycle test', function () {
         });
     }
 
+    function invalidPassword(callback) {
+        superagent.get('https://' + app.fqdn).auth(username, password + 'x').end(function (error, result) {
+            expect(result.status).to.eql(401);
+
+            callback();
+        });
+    }
+
     function loadPage(callback) {
         browser.manage().deleteAllCookies().then(function () {
             return browser.get('https://' + username + ':' + encodeURIComponent(password) + '@' + app.fqdn).then(function () {
@@ -135,6 +144,7 @@ describe('Application life cycle test', function () {
         expect(app).to.be.an('object');
     });
 
+    it('fails with invalid password', invalidPassword);
     it('can load page', loadPage);
     it('can add folder', addFolder);