Commit bc10d450 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

user panel refactored - old functions changed to new type of calls

parent 20f479f6
......@@ -28,8 +28,8 @@ function UserPanel(params) {
var loginButton = self.getControlElement(PanelControlElementType.USER_TAB_LOGIN_BUTTON);
var logoutButton = self.getControlElement(PanelControlElementType.USER_TAB_LOGOUT_BUTTON);
loginButton.onclick = function(){
var login = self.getLoginText().value;
var password = self.getPasswordText().value;
var login = self.getControlElement(PanelControlElementType.USER_TAB_LOGIN_INPUT_TEXT).value;
var password = self.getControlElement(PanelControlElementType.USER_TAB_PASSOWRD_INPUT_TEXT).value;
return ServerConnector.login(login, password).then(function(){
window.location.reload(false);
......
......@@ -5,6 +5,7 @@ var Helper = require('../helper');
require("../mocha-config.js");
var UserPanel = require('../../../main/js/gui/UserPanel');
var PanelControlElementType = require('../../../main/js/gui/PanelControlElementType');
var chai = require('chai');
var assert = chai.assert;
......@@ -55,4 +56,17 @@ describe('UserPanel', function() {
panel.showLoginPage();
});
it('login', function() {
var div = helper.createUserTab();
var map = helper.createCustomMap();
var panel = new UserPanel({
element : div,
customMap : map
});
return panel.getControlElement(PanelControlElementType.USER_TAB_LOGIN_BUTTON).onclick();
});
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment