1
0
mirror of https://github.com/hakimel/reveal.js.git synced 2025-04-20 04:21:58 +02:00

add tests

This commit is contained in:
Florian Klien 2023-05-12 15:45:29 +02:00
parent 0b44308754
commit bf749ee1da

View File

@ -274,6 +274,13 @@
```
</script>
</section>
<section data-markdown class="with-offset">
<script type="text/template">
```[123:]
code
```
</script>
</section>
<section data-markdown class="with-line-highlights-and-lanugage">
<script type="text/template">
```javascript [1,2,3]
@ -281,6 +288,20 @@
```
</script>
</section>
<section data-markdown class="with-line-highlights-offset-and-lanugage">
<script type="text/template">
```javascript [456: 3,4,5]
code
```
</script>
</section>
<section data-markdown class="with-line-offset-and-lanugage">
<script type="text/template">
```javascript [756:]
code
```
</script>
</section>
<section data-markdown class="with-code-in-fragment">
<script type="text/template">
```js
@ -460,9 +481,22 @@
assert.strictEqual( deck6.getRevealElement().querySelectorAll( '.with-line-highlights .hljs[data-line-numbers="1,2,3"]' ).length, 1 );
});
QUnit.test( '```[234: ] line offset only', function( assert ) {
assert.strictEqual( deck6.getRevealElement().querySelectorAll( '.with-offset .hljs[data-ln-start-from="123"]' ).length, 1 );
});
QUnit.test( '```javascript [1,2,3] enables line highlights and sets language', function( assert ) {
assert.strictEqual( deck6.getRevealElement().querySelectorAll( '.with-line-highlights-and-lanugage .hljs.javascript[data-line-numbers="1,2,3"]' ).length, 1 );
});
QUnit.test( '```javascript [123: 3,4,5] add line offset and enables line highlights and sets language', function( assert ) {
assert.strictEqual( deck6.getRevealElement().querySelectorAll( '.with-line-highlights-offset-and-lanugage .hljs.javascript[data-line-numbers="3,4,5"]' ).length, 1 );
assert.strictEqual( deck6.getRevealElement().querySelectorAll( '.with-line-highlights-offset-and-lanugage .hljs.javascript[data-ln-start-from="456"]' ).length, 1 );
});
QUnit.test( '```javascript [756:] add line offset and sets no line highlights and sets language', function( assert ) {
assert.strictEqual( deck6.getRevealElement().querySelectorAll( '.with-line-offset-and-lanugage .hljs.javascript[data-ln-start-from="756"]' ).length, 1 );
});
QUnit.test( '```block should allow custom fragment', function( assert ) {
assert.strictEqual( deck6.getRevealElement().querySelectorAll( '.with-code-in-fragment pre.fragment' ).length, 1 );