diff --git a/.gitignore b/.gitignore index a52161c2a3..ee3db0e4a3 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ /sitemgr/ /stylite/ /swool/ +/test/ /tracker/ /usage/ /vendor/ diff --git a/package.json b/package.json index 13b4b22078..fe832cd0fe 100644 --- a/package.json +++ b/package.json @@ -8,19 +8,12 @@ "devDependencies": { "@types/jquery": "^3.5.5", "@types/jqueryui": "^1.12.14", - "chai": "^4.2.0", "grunt": "^1.3.0", "grunt-contrib-cssmin": "^2.2.1", "grunt-newer": "^1.3.0", "grunt-terser": "^1.0.0", "grunt-ts": "^6.0.0-beta.22", - "jsdom": "16.4.0", - "mocha": "^8.2.1", "terser": "^4.8.0", "typescript": "^3.9.7" - }, - "scripts": { - "test": "mocha", - "debug-test": "mocha --inspect-brk" } } diff --git a/test/loginSpec.js b/test/loginSpec.js deleted file mode 100644 index 2b548cfa1f..0000000000 --- a/test/loginSpec.js +++ /dev/null @@ -1,39 +0,0 @@ -let expect = require('chai').expect; -const { JSDOM } = require('jsdom'), - -// the file I will be loading - uri = 'https://boulder.egroupware.org/egroupware/login.php', - -// the options that I will be giving to jsdom - options = { - runScripts: 'dangerously', // 'outside-only' does NOT work for scripts in the loaded page! - resources: 'usable' - }; - -// load from an external file -describe('EGroupware login-page', function() { - it('Should load egw object', function() { - debugger - return JSDOM.fromURL(uri, options).then(function (dom) { - let window = dom.window, - document = window.document; - expect(document.querySelectorAll('form')).key(0); - expect(document.querySelectorAll('form')[0].action).to.be.a('string').and.satisfy(msg => msg.startsWith(uri)); - return new Promise((resolve, reject) => { - window.onload = resolve; - }).then(function() { - console.log('Window loaded :)'); - return new Promise((resolve, reject) => { - window.egw_LAB.wait(function() { - console.log('Async script-loading / egw_LAB done :)') - resolve(window.egw); - }); - }) - }); - }).then(function(egw) { - expect(egw.webserverUrl).equal('/egroupware', 'egw.webserverURL !== "/egroupware"'); - expect(egw.lang('Test12345 %1', 'success')).to.equal('Test12345 success'); - egw.window.close(); - }) - }) -})