From bf3ec231dd2a38c5ac157f8068607d79dd8045c6 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 28 Jun 2018 19:01:26 +0200 Subject: [PATCH] Optimizing tests --- Auth/Auth.js | 1 + DataStorage/CookieJar.js | 89 ------------------------------ tests/DataStorage/CookieJarTest.js | 12 ---- tests/SpecRunner.html | 6 +- 4 files changed, 6 insertions(+), 102 deletions(-) delete mode 100644 DataStorage/CookieJar.js delete mode 100644 tests/DataStorage/CookieJarTest.js diff --git a/Auth/Auth.js b/Auth/Auth.js index 8bf9913..e3eb7cd 100644 --- a/Auth/Auth.js +++ b/Auth/Auth.js @@ -62,6 +62,7 @@ login () { const authRequest = new jsOMS.Message.Request.Request(); + authRequest.setUri(this.uri); authRequest.setMethod(jsOMS.Message.Request.RequestMethod.POST); authRequest.setResponseType(jsOMS.Message.Request.RequestType.JSON); diff --git a/DataStorage/CookieJar.js b/DataStorage/CookieJar.js deleted file mode 100644 index 207205b..0000000 --- a/DataStorage/CookieJar.js +++ /dev/null @@ -1,89 +0,0 @@ -/** - * CookieJar class. - * - * @copyright Dennis Eichhorn - * @license OMS License 1.0 - * @version 1.0.0 - * @since 1.0.0 - */ -(function (jsOMS) -{ - "use strict"; - - jsOMS.Autoloader.defineNamespace('jsOMS.DataStorage'); - - /** - * @constructor - * - * @since 1.0.0 - */ - jsOMS.DataStorage.CookieJar = class { - constructor () - { - } - - /** - * Saving data to cookie - * - * @param {string} cName Cookie name - * @param {string} value Value to save - * @param {number} exdays Lifetime for the cookie - * @param {string} domain Domain for the cookie - * @param {string} path Path for the cookie - * - * @return array - * - * @method - * - * @since 1.0.0 - */ - setCookie (cName, value, exdays, domain, path) - { - const exdate = new Date(); - exdate.setDate(exdate.getDate() + exdays); - - const cValue = encodeURI(value) - + ((exdays === null) ? "" : "; expires=" - + exdate.toUTCString()) + ";domain=" - + domain + ";path=" - + path; - - document.cookie = cName + "=" + cValue; - }; - - /** - * Loading cookie data - * - * @param {string} cName Cookie name - * - * @return {string} - * - * @method - * - * @since 1.0.0 - */ - getCookie (cName) - { - let cValue = document.cookie, - cStart = cValue.indexOf(" " + cName + "="); - - if (cStart === -1) { - cStart = cValue.indexOf(cName + "="); - } - - if (cStart === -1) { - cValue = null; - } else { - cStart = cValue.indexOf("=", cStart) + 1; - let cEnd = cValue.indexOf(";", cStart); - - if (cEnd === -1) { - cEnd = cValue.length; - } - - cValue = decodeURI(cValue.substring(cStart, cEnd)); - } - return cValue; - }; - }; -}(window.jsOMS = window.jsOMS || {})); diff --git a/tests/DataStorage/CookieJarTest.js b/tests/DataStorage/CookieJarTest.js deleted file mode 100644 index aed0c8f..0000000 --- a/tests/DataStorage/CookieJarTest.js +++ /dev/null @@ -1,12 +0,0 @@ -describe('CookieJarTest', function () -{ - "use strict"; - - beforeEach(function () - { - }); - - afterEach(function () - { - }); -}); diff --git a/tests/SpecRunner.html b/tests/SpecRunner.html index 574301d..2356603 100644 --- a/tests/SpecRunner.html +++ b/tests/SpecRunner.html @@ -23,15 +23,19 @@ + + + + - +