From f007e075443f86dda56e4410b9e7460f8431c282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Ho=CC=88=C3=9Fl?= Date: Mon, 6 Apr 2020 10:03:23 +0200 Subject: [PATCH] Delete old test files that are reimplemented in Typescript by now --- tests/karma/karma.conf.js | 77 -- tests/karma/motions/diff.service.test.js | 799 ------------------ .../motions/linenumbering.service.test.js | 482 ----------- 3 files changed, 1358 deletions(-) delete mode 100644 tests/karma/karma.conf.js delete mode 100644 tests/karma/motions/diff.service.test.js delete mode 100644 tests/karma/motions/linenumbering.service.test.js diff --git a/tests/karma/karma.conf.js b/tests/karma/karma.conf.js deleted file mode 100644 index fa3ebf6a0..000000000 --- a/tests/karma/karma.conf.js +++ /dev/null @@ -1,77 +0,0 @@ -// Karma configuration -// Generated on Sun Jun 26 2016 14:46:31 GMT+0200 (CEST) - -module.exports = function(config) { - config.set({ - - // base path that will be used to resolve all patterns (eg. files, exclude) - basePath: '../..', - - - // frameworks to use - // available frameworks: https://npmjs.org/browse/keyword/karma-adapter - frameworks: ['jasmine'], - - - // list of files / patterns to load in the browser - files: [ - 'openslides/static/js/openslides-libs.js', - 'node_modules/angular-mocks/angular-mocks.js', - 'openslides/motions/static/js/motions/linenumbering.js', - 'openslides/motions/static/js/motions/diff.js', - 'openslides/core/static/js/core/pdf.js', - 'tests/karma/*/*.test.js' - ], - - - // list of files to exclude - exclude: [ - ], - - - // preprocess matching files before serving them to the browser - // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor - preprocessors: { - }, - - - // test results reporter to use - // possible values: 'dots', 'progress' - // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['progress'], - - - // web server port - port: 9876, - - - // enable / disable colors in the output (reporters and logs) - colors: true, - - - // level of logging - // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG - logLevel: config.LOG_INFO, - - client: { - captureConsole: true - }, - - // enable / disable watching file and executing tests whenever any file changes - autoWatch: true, - - - // start these browsers - // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher - browsers: ['Chrome', 'PhantomJS'], - - - // Continuous Integration mode - // if true, Karma captures browsers, runs the tests and exits - singleRun: true, - - // Concurrency level - // how many browser should be started simultaneous - concurrency: Infinity - }) -} diff --git a/tests/karma/motions/diff.service.test.js b/tests/karma/motions/diff.service.test.js deleted file mode 100644 index 5891aa047..000000000 --- a/tests/karma/motions/diff.service.test.js +++ /dev/null @@ -1,799 +0,0 @@ -describe('linenumbering', function () { - - beforeEach(module('OpenSlidesApp.motions.diff')); - - var diffService, baseHtml1, baseHtmlDom1, baseHtml2, baseHtmlDom2, baseHtml3, baseHtmlDom3, - brMarkup = function (no) { - return '
' + - ' '; - }, - noMarkup = function (no) { - return ' '; - }; - - beforeEach(inject(function (_diffService_, _lineNumberingService_) { - diffService = _diffService_; - lineNumberingService = _lineNumberingService_; - - baseHtml1 = '

' + - noMarkup(1) + 'Line 1 ' + brMarkup(2) + 'Line 2 ' + - brMarkup(3) + 'Line 3
' + noMarkup(4) + 'Line 4 ' + brMarkup(5) + 'Line
5

' + - '' + - '

' + noMarkup(10) + 'Line 10 ' + brMarkup(11) + 'Line 11

'; - baseHtmlDom1 = diffService.htmlToFragment(baseHtml1); - - baseHtml2 = '

' + noMarkup(1) + 'Single text line

\ -

' + noMarkup(2) + 'sdfsdfsdfsdf dsfsdfsdfdsflkewjrl ksjfl ksdjf klnlkjBavaria ipsum dolor sit amet Biazelt Auffisteign ' + brMarkup(3) + 'Schorsch mim Radl foahn Ohrwaschl Steckerleis wann griagd ma nacha wos z’dringa glacht Mamalad, ' + - brMarkup(4) + 'muass? I bin a woschechta Bayer sowos oamoi und sei und glei wirds no fui lustiga: Jo mei khkhis des ' + brMarkup(5) + 'schee middn ognudelt, Trachtnhuat Biawambn gscheid: Griasd eich midnand etza nix Gwiass woass ma ned ' + - brMarkup(6) + 'owe. Dahoam gscheckate middn Spuiratz des is a gmahde Wiesn. Des is schee so Obazda san da, Haferl ' + brMarkup(7) + 'pfenningguat schoo griasd eich midnand.

\ -\ -

' + noMarkup(14) + 'I waar soweid Blosmusi es nomoi. Broadwurschtbudn des is a gmahde Wiesn Kirwa mogsd a Bussal ' + brMarkup(15) + 'Guglhupf schüds nei. Luja i moan oiwei Baamwach Watschnbaam, wiavui baddscher! Biakriagal a fescha ' + - brMarkup(16) + '1Bua Semmlkneedl iabaroi oba um Godds wujn Ledahosn wui Greichats. Geh um Godds wujn luja heid ' + brMarkup(17) + 'greaßt eich nachad woaß Breihaus eam! De om auf’n Gipfe auf gehds beim Schichtl mehra Baamwach a ' + brMarkup(18) + 'bissal wos gehd ollaweil gscheid:

\ -
\ -

' + noMarkup(19) + 'Scheans Schdarmbeaga See i hob di narrisch gean i jo mei is des schee! Nia eam ' + brMarkup(20) + 'hod vasteh i sog ja nix, i red ja bloß sammawiedaguad, umma eana obandeln! Zwoa ' + brMarkup(21) + 'jo mei scheans amoi, san und hoggd Milli barfuaßat gscheit. Foidweg vui huift ' + - brMarkup(22) + 'vui singan, mehra Biakriagal om auf’n Gipfe! Ozapfa sodala Charivari greaßt eich ' + brMarkup(23) + 'nachad Broadwurschtbudn do middn liberalitas Bavariae sowos Leonhardifahrt:

\ -
\ -

' + noMarkup(24) + 'Wui helfgod Wiesn, ognudelt schaugn: Dahoam gelbe Rüam Schneid singan wo hi sauba i moan scho aa no ' + brMarkup(25) + 'a Maß a Maß und no a Maß nimma. Is umananda a ganze Hoiwe zwoa, Schneid. Vui huift vui Brodzeid kumm ' + - brMarkup(26) + 'geh naa i daad vo de allerweil, gor. Woaß wia Gams, damischa. A ganze Hoiwe Ohrwaschl Greichats ' + brMarkup(27) + 'iabaroi Prosd Engelgwand nix Reiwadatschi.Weibaleid ognudelt Ledahosn noch da Giasinga Heiwog i daad ' + - brMarkup(28) + 'Almrausch, Ewig und drei Dog nackata wea ko, dea ko. Meidromml Graudwiggal nois dei, nackata. No ' + brMarkup(29) + 'Diandldrahn nix Gwiass woass ma ned hod boarischer: Samma sammawiedaguad wos, i hoam Brodzeid. Jo ' + - brMarkup(30) + 'mei Sepp Gaudi, is ma Wuascht do Hendl Xaver Prosd eana an a bravs. Sauwedda an Brezn, abfieseln.

'; - baseHtmlDom2 = diffService.htmlToFragment(baseHtml2); - - baseHtml3 = '
    ' + - '
  1. ' + noMarkup(1) + 'Line 1
  2. ' + - '
  3. ' + noMarkup(2) + 'Line 2
  4. ' + - '
    1. ' + - '
    2. ' + noMarkup(3) + 'Line 3.1
    3. ' + - '
    4. ' + noMarkup(4) + 'Line 3.2
    5. ' + - '
    6. ' + noMarkup(5) + 'Line 3.3
    7. ' + - '
  5. ' + - '
  6. ' + noMarkup(6) + ' Line 4
'; - baseHtmlDom3 = diffService.htmlToFragment(baseHtml3); - - diffService._insertInternalLineMarkers(baseHtmlDom1); - diffService._insertInternalLineMarkers(baseHtmlDom2); - })); - - - describe('extraction of lines', function () { - it('locates line number nodes', function() { - var lineNumberNode = diffService.getLineNumberNode(baseHtmlDom1, 4); - expect(lineNumberNode.parentNode.nodeName).toBe('STRONG'); - - lineNumberNode = diffService.getLineNumberNode(baseHtmlDom1, 9); - expect(lineNumberNode.parentNode.nodeName).toBe('UL'); - - lineNumberNode = diffService.getLineNumberNode(baseHtmlDom1, 15); - expect(lineNumberNode).toBe(null); - }); - - it('finds the common ancestor', function() { - var fromLineNode, toLineNode, commonAncestor; - - fromLineNode = diffService.getLineNumberNode(baseHtmlDom1, 6); - toLineNode = diffService.getLineNumberNode(baseHtmlDom1, 7); - commonAncestor = diffService._getCommonAncestor(fromLineNode, toLineNode); - expect(commonAncestor.commonAncestor.nodeName).toBe("#document-fragment"); - - fromLineNode = diffService.getLineNumberNode(baseHtmlDom1, 6); - toLineNode = diffService.getLineNumberNode(baseHtmlDom1, 8); - commonAncestor = diffService._getCommonAncestor(fromLineNode, toLineNode); - expect(commonAncestor.commonAncestor.nodeName).toBe("#document-fragment"); - - fromLineNode = diffService.getLineNumberNode(baseHtmlDom1, 6); - toLineNode = diffService.getLineNumberNode(baseHtmlDom1, 10); - commonAncestor = diffService._getCommonAncestor(fromLineNode, toLineNode); - expect(commonAncestor.commonAncestor.nodeName).toBe("#document-fragment"); - - }); - - it('renders DOMs correctly (1)', function() { - var lineNo = diffService.getLineNumberNode(baseHtmlDom1, 7), - greatParent = lineNo.parentNode.parentNode, - lineTrace = [lineNo.parentNode, lineNo]; - - var pre = diffService._serializePartialDomToChild(greatParent, lineTrace, true); - expect(pre).toBe(''); - }); - - it('renders DOMs correctly (2)', function() { - var lineNo = diffService.getLineNumberNode(baseHtmlDom1, 9), - greatParent = lineNo.parentNode.parentNode, - lineTrace = [lineNo.parentNode, lineNo]; - - var pre = diffService._serializePartialDomToChild(greatParent, lineTrace, true); - expect(pre).toBe('
  • '); - expect(diff.followingHtmlStartSnippet).toBe('