Christophe Dervieux | e1893ae | 2021-10-07 17:09:02 +0200 | [diff] [blame] | 1 | <!doctype html> |
| 2 | <html lang="en"> |
| 3 | |
| 4 | <head> |
| 5 | <meta charset="utf-8"> |
| 6 | |
| 7 | <title>reveal.js - Test Grid</title> |
| 8 | |
| 9 | <link rel="stylesheet" href="../dist/reveal.css"> |
| 10 | <link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css"> |
| 11 | <script src="../node_modules/qunit/qunit/qunit.js"></script> |
| 12 | </head> |
| 13 | |
| 14 | <body style="overflow: auto;"> |
| 15 | |
| 16 | <div id="qunit"></div> |
| 17 | <div id="qunit-fixture"></div> |
| 18 | |
| 19 | <div class="reveal" style="display: none;"> |
| 20 | |
| 21 | <div class="slides"> |
| 22 | |
| 23 | <section>0</section> |
| 24 | <section> |
| 25 | <section>1.1</section> |
| 26 | <section>1.2</section> |
| 27 | <section>1.3</section> |
| 28 | <section>1.4</section> |
| 29 | </section> |
| 30 | <section> |
| 31 | <section>2.1</section> |
| 32 | <section>2.2</section> |
| 33 | <section>2.3</section> |
| 34 | <section>2.4</section> |
| 35 | </section> |
| 36 | |
| 37 | </div> |
| 38 | |
| 39 | </div> |
| 40 | |
| 41 | <script src="../dist/reveal.js"></script> |
| 42 | <script> |
| 43 | Reveal.initialize().then( () => { |
| 44 | |
| 45 | QUnit.module( 'Grid Navigation' ); |
| 46 | |
| 47 | QUnit.test( 'Disabled', function( assert ) { |
| 48 | Reveal.right(); |
| 49 | Reveal.down(); |
| 50 | Reveal.down(); |
| 51 | assert.deepEqual( Reveal.getIndices(), { h: 1, v: 2, f: undefined }, 'Correct starting point' ); |
| 52 | Reveal.right(); |
| 53 | assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: undefined }, 'Moves to top when going to adjacent stack' ); |
| 54 | }); |
| 55 | |
| 56 | QUnit.test( 'Enabled', function( assert ) { |
| 57 | Reveal.configure({ navigationMode: 'grid' }); |
| 58 | Reveal.slide( 0, 0 ); |
| 59 | Reveal.right(); |
| 60 | Reveal.down(); |
| 61 | Reveal.down(); |
| 62 | assert.deepEqual( Reveal.getIndices(), { h: 1, v: 2, f: undefined }, 'Correct starting point' ); |
| 63 | Reveal.right(); |
| 64 | assert.deepEqual( Reveal.getIndices(), { h: 2, v: 2, f: undefined }, 'Remains at same vertical index when going to adjacent stack' ); |
| 65 | }); |
| 66 | |
| 67 | } ); |
| 68 | </script> |
| 69 | |
| 70 | </body> |
| 71 | </html> |