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> |
Marc Kupietz | 09b7575 | 2023-10-07 09:32:19 +0200 | [diff] [blame^] | 43 | QUnit.config.testTimeout = 30000; |
| 44 | QUnit.config.autostart = false; |
| 45 | QUnit.module( 'Grid Navigation' ); |
| 46 | |
Christophe Dervieux | e1893ae | 2021-10-07 17:09:02 +0200 | [diff] [blame] | 47 | Reveal.initialize().then( () => { |
| 48 | |
Marc Kupietz | 09b7575 | 2023-10-07 09:32:19 +0200 | [diff] [blame^] | 49 | QUnit.start(); |
Christophe Dervieux | e1893ae | 2021-10-07 17:09:02 +0200 | [diff] [blame] | 50 | |
| 51 | QUnit.test( 'Disabled', function( assert ) { |
| 52 | Reveal.right(); |
| 53 | Reveal.down(); |
| 54 | Reveal.down(); |
| 55 | assert.deepEqual( Reveal.getIndices(), { h: 1, v: 2, f: undefined }, 'Correct starting point' ); |
| 56 | Reveal.right(); |
| 57 | assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: undefined }, 'Moves to top when going to adjacent stack' ); |
| 58 | }); |
| 59 | |
| 60 | QUnit.test( 'Enabled', function( assert ) { |
| 61 | Reveal.configure({ navigationMode: 'grid' }); |
| 62 | Reveal.slide( 0, 0 ); |
| 63 | Reveal.right(); |
| 64 | Reveal.down(); |
| 65 | Reveal.down(); |
| 66 | assert.deepEqual( Reveal.getIndices(), { h: 1, v: 2, f: undefined }, 'Correct starting point' ); |
| 67 | Reveal.right(); |
| 68 | assert.deepEqual( Reveal.getIndices(), { h: 2, v: 2, f: undefined }, 'Remains at same vertical index when going to adjacent stack' ); |
| 69 | }); |
| 70 | |
| 71 | } ); |
| 72 | </script> |
| 73 | |
| 74 | </body> |
| 75 | </html> |