mirror of
https://git.cloudron.io/cloudron/syncthing-app
synced 2025-09-24 22:07:36 +00:00
add bad login test
This commit is contained in:
10
test/test.js
10
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);
|
||||
|
||||
|
Reference in New Issue
Block a user