mirror of
https://github.com/hakimel/reveal.js.git
synced 2025-08-06 14:47:04 +02:00
add tests
This commit is contained in:
@@ -274,6 +274,13 @@
|
|||||||
```
|
```
|
||||||
</script>
|
</script>
|
||||||
</section>
|
</section>
|
||||||
|
<section data-markdown class="with-offset">
|
||||||
|
<script type="text/template">
|
||||||
|
```[123:]
|
||||||
|
code
|
||||||
|
```
|
||||||
|
</script>
|
||||||
|
</section>
|
||||||
<section data-markdown class="with-line-highlights-and-lanugage">
|
<section data-markdown class="with-line-highlights-and-lanugage">
|
||||||
<script type="text/template">
|
<script type="text/template">
|
||||||
```javascript [1,2,3]
|
```javascript [1,2,3]
|
||||||
@@ -281,6 +288,20 @@
|
|||||||
```
|
```
|
||||||
</script>
|
</script>
|
||||||
</section>
|
</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">
|
<section data-markdown class="with-code-in-fragment">
|
||||||
<script type="text/template">
|
<script type="text/template">
|
||||||
```js
|
```js
|
||||||
@@ -460,10 +481,23 @@
|
|||||||
assert.strictEqual( deck6.getRevealElement().querySelectorAll( '.with-line-highlights .hljs[data-line-numbers="1,2,3"]' ).length, 1 );
|
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 ) {
|
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 );
|
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 ) {
|
QUnit.test( '```block should allow custom fragment', function( assert ) {
|
||||||
assert.strictEqual( deck6.getRevealElement().querySelectorAll( '.with-code-in-fragment pre.fragment' ).length, 1 );
|
assert.strictEqual( deck6.getRevealElement().querySelectorAll( '.with-code-in-fragment pre.fragment' ).length, 1 );
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user