diff options
| author | Timotheus Kampik <timotheus.kampik@gmail.com> | 2019-01-12 15:58:07 +0100 |
|---|---|---|
| committer | Timotheus Kampik <timotheus.kampik@gmail.com> | 2019-01-12 15:58:07 +0100 |
| commit | 64e64ffbd49b3af5a1b0eb82891ac5cbc571827b (patch) | |
| tree | d7fe0dd1af67fdb3c03fd5698f7df9e0e56191cc /tests/js | |
| parent | c761ec248b00333db007a5286e950f9c2d12d146 (diff) | |
| download | sphinx-git-64e64ffbd49b3af5a1b0eb82891ac5cbc571827b.tar.gz | |
#5258 allow for some variability in test
Diffstat (limited to 'tests/js')
| -rw-r--r-- | tests/js/doctools.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/js/doctools.js b/tests/js/doctools.js index 37064334a..54246f635 100644 --- a/tests/js/doctools.js +++ b/tests/js/doctools.js @@ -62,19 +62,21 @@ describe('jQuery extensions', function() { jQuery(document.body).append(highlightTestSvg); highlightTestSvg.highlightText(cyrillicTerm, 'highlighted'); highlightTestSvg.highlightText(umlautTerm, 'highlighted'); + /* Note wild cards and ``toMatch``; allowing for some variability + seems to be necessary, even between different FF versions */ var expectedSvgString = '<svg xmlns="http://www.w3.org/2000/svg" height="50" width="500">' + - '<rect x="-0.5" y="3" width="271.683" height="16" class="highlighted">' + + '<rect x=".*" y=".*" width=".*" height=".*" class="highlighted">' + '</rect>' + - '<rect x="-0.5" y="3" width="271.683" height="16" class="highlighted">' + + '<rect x=".*" y=".*" width=".*" height=".*" class="highlighted">' + '</rect>' + - '<text x="0" y="15">' + + '<text x=".*" y=".*">' + 'This is the ' + '<tspan>шеллы</tspan> and ' + '<tspan>Gänsefüßchen</tspan> test!' + '</text>' + '</svg>'; - expect(highlightTestSvg.html()).toEqual(expectedSvgString); + expect(highlightTestSvg.html()).toMatch(new RegExp(expectedSvgString)); }); }); |
