'use strict';

import Login from '../src/Login';

describe('Login', function() {
	it('should be tested', function() {
		assert.fail('No tests for this module yet.');
	});
});

@@ -78,29 +78,281 @@
 ) %7B%0A
-%09it('should be tested
+%0A%09beforeEach(function () %7B%0A%09%09this.xhr = sinon.useFakeXMLHttpRequest();%0A%09%09var requests = this.requests = %5B%5D;%0A%09%09this.xhr.onCreate = function (xhr) %7B%0A%09%09%09requests.push(xhr);%0A%09%09%7D;%0A%09%7D);%0A%0A%09afterEach(function () %7B%0A%09%09this.xhr.restore();%0A%09%7D);%0A%0A%0A%09it('should add a component to the DOM
 ', f
@@ -365,16 +365,19 @@
 n() %7B%0A%09%09
+// 
 assert.f
@@ -413,16 +413,941 @@
  yet.');
+%0A%0A%09%09let login = new Login();%0A%09%09let el = document.querySelector('.loginmodal-container');%0A%09%09assert.ok(el);%0A%09%7D);%0A%0A%09it('should try to login and emit an error event if it fails', function(done) %7B%0A%09%09let callback = sinon.spy();%0A%09%09let login = new Login();%0A%0A%09%09login.on('loginError', function () %7B%0A%09%09%09callback();%0A%09%09%09assert.deepEqual(callback.called, true);%0A%09%09%09done();%0A%09%09%7D);%0A%0A%09%09let btn = login.element.querySelector('input%5Btype=%22submit%22%5D');%0A%09%09btn.click();%0A%09%7D);%0A%0A%09it('should try to login and emit a success event if it works', function(done) %7B%0A%09%09let callback = sinon.spy();%0A%0A%09%09let login = new Login();%0A%09%09login.userEl.value = 'test';%0A%09%09login.passEl.value = 'test';%0A%0A%09%09login.on('loginSuccess', function (val) %7B%0A%09%09%09callback();%0A%09%09%09assert.deepEqual(callback.called, true);%0A%09%09%09assert.deepEqual(val.status, 200);%0A%09%09%09done();%0A%09%09%7D);%0A%0A%09%09let btn = login.element.querySelector('input%5Btype=%22submit%22%5D');%0A%09%09btn.click();%0A%09%09this.requests%5B0%5D.respond(200);
 %0A%09%7D);%0A%7D)

Add test for login component