spec updates

This commit is contained in:
hakimel 2023-01-10 10:24:41 +01:00
parent 2eb6d1e71c
commit a815c7d269
15 changed files with 823 additions and 255 deletions

906
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -51,8 +51,8 @@
"gulp-zip": "^4.2.0", "gulp-zip": "^4.2.0",
"highlight.js": "^10.0.3", "highlight.js": "^10.0.3",
"marked": "^4.0.12", "marked": "^4.0.12",
"node-qunit-puppeteer": "^2.1.0", "node-qunit-puppeteer": "^2.1.2",
"qunit": "^2.17.2", "qunit": "^2.19.3",
"rollup": "^2.48.0", "rollup": "^2.48.0",
"rollup-plugin-terser": "^7.0.2", "rollup-plugin-terser": "^7.0.2",
"sass": "^1.39.2", "sass": "^1.39.2",

View File

@ -65,6 +65,7 @@
<script src="../dist/reveal.js"></script> <script src="../dist/reveal.js"></script>
<script> <script>
QUnit.config.testTimeout = 30000;
QUnit.config.reorder = false; QUnit.config.reorder = false;
const slides = Array.prototype.map.call( document.querySelectorAll( '.slides section' ), slide => { const slides = Array.prototype.map.call( document.querySelectorAll( '.slides section' ), slide => {

View File

@ -31,6 +31,7 @@
var externalScriptSequence = ''; var externalScriptSequence = '';
var scriptCount = 0; var scriptCount = 0;
QUnit.config.testTimeout = 30000;
QUnit.config.autostart = false; QUnit.config.autostart = false;
QUnit.module( 'Async Dependencies' ); QUnit.module( 'Async Dependencies' );

View File

@ -30,6 +30,10 @@
<script> <script>
window.externalScriptSequence = ''; window.externalScriptSequence = '';
QUnit.config.testTimeout = 30000;
QUnit.config.autostart = false;
QUnit.module( 'Dependencies' );
Reveal.initialize({ Reveal.initialize({
dependencies: [ dependencies: [
{ src: 'assets/external-script-a.js' }, { src: 'assets/external-script-a.js' },
@ -38,7 +42,7 @@
] ]
}).then( () => { }).then( () => {
QUnit.module( 'Dependencies' ); QUnit.start();
QUnit.test( 'Load synchronous scripts', function( assert ) { QUnit.test( 'Load synchronous scripts', function( assert ) {
assert.strictEqual( window.externalScriptSequence, 'ABC', 'Loaded and executed in order' ); assert.strictEqual( window.externalScriptSequence, 'ABC', 'Loaded and executed in order' );

View File

@ -40,9 +40,13 @@
<script src="../dist/reveal.js"></script> <script src="../dist/reveal.js"></script>
<script> <script>
QUnit.config.testTimeout = 30000;
QUnit.config.autostart = false;
QUnit.module( 'Grid Navigation' );
Reveal.initialize().then( () => { Reveal.initialize().then( () => {
QUnit.module( 'Grid Navigation' ); QUnit.start();
QUnit.test( 'Disabled', function( assert ) { QUnit.test( 'Disabled', function( assert ) {
Reveal.right(); Reveal.right();

View File

@ -34,6 +34,8 @@
<script src="../dist/reveal.js"></script> <script src="../dist/reveal.js"></script>
<script> <script>
QUnit.config.testTimeout = 30000;
Reveal.initialize({ viewDistance: 3 }).then( () => { Reveal.initialize({ viewDistance: 3 }).then( () => {
function getIframe( index ) { function getIframe( index ) {

View File

@ -34,6 +34,8 @@
<script src="../dist/reveal.js"></script> <script src="../dist/reveal.js"></script>
<script> <script>
QUnit.config.testTimeout = 30000;
Reveal.initialize({ viewDistance: 2 }).then( () => { Reveal.initialize({ viewDistance: 2 }).then( () => {
var defaultIframe = document.querySelector( '.default-iframe' ), var defaultIframe = document.querySelector( '.default-iframe' ),

View File

@ -298,6 +298,8 @@
import Markdown from '../plugin/markdown/markdown.esm.js' import Markdown from '../plugin/markdown/markdown.esm.js'
import Highlight from '../plugin/highlight/highlight.esm.js' import Highlight from '../plugin/highlight/highlight.esm.js'
QUnit.config.testTimeout = 30000;
let deck1 = new Reveal( document.querySelector( '.deck1' ), { plugins: [ Markdown ] }) let deck1 = new Reveal( document.querySelector( '.deck1' ), { plugins: [ Markdown ] })
deck1.addEventListener( 'ready', function() { deck1.addEventListener( 'ready', function() {

View File

@ -40,6 +40,7 @@
<script src="../plugin/zoom/zoom.js"></script> <script src="../plugin/zoom/zoom.js"></script>
<script> <script>
QUnit.config.testTimeout = 30000;
QUnit.module( 'Multiple reveal.js instances' ); QUnit.module( 'Multiple reveal.js instances' );
let r1 = new Reveal( document.querySelector( '.deck1 .reveal' ), { let r1 = new Reveal( document.querySelector( '.deck1 .reveal' ), {

View File

@ -41,6 +41,7 @@
import Reveal from '../dist/reveal.esm.js'; import Reveal from '../dist/reveal.esm.js';
import Zoom from '../plugin/zoom/zoom.esm.js'; import Zoom from '../plugin/zoom/zoom.esm.js';
QUnit.config.testTimeout = 30000;
QUnit.module( 'Multiple reveal.js instances' ); QUnit.module( 'Multiple reveal.js instances' );
let r1 = new Reveal( document.querySelector( '.deck1 .reveal' ), { let r1 = new Reveal( document.querySelector( '.deck1 .reveal' ), {

View File

@ -75,8 +75,13 @@
<script src="../dist/reveal.js"></script> <script src="../dist/reveal.js"></script>
<script> <script>
QUnit.config.testTimeout = 30000;
QUnit.config.autostart = false;
Reveal.initialize({ pdf: true }).then( function() { Reveal.initialize({ pdf: true }).then( function() {
QUnit.start();
// Only one test for now, we're mainly ensuring that there // Only one test for now, we're mainly ensuring that there
// are no execution errors when running PDF mode // are no execution errors when running PDF mode

View File

@ -29,6 +29,7 @@
<script src="../dist/reveal.js"></script> <script src="../dist/reveal.js"></script>
<script> <script>
QUnit.config.testTimeout = 30000;
QUnit.module( 'Plugins' ); QUnit.module( 'Plugins' );
var initCounter = { PluginB: 0, PluginC: 0, PluginD: 0 }; var initCounter = { PluginB: 0, PluginC: 0, PluginD: 0 };

View File

@ -39,8 +39,7 @@
<script src="../dist/reveal.js"></script> <script src="../dist/reveal.js"></script>
<script> <script>
Reveal.initialize().then( function() { Reveal.initialize();
console.log(Reveal);
QUnit.module( 'State' ); QUnit.module( 'State' );
@ -129,7 +128,6 @@
Reveal.off( 'state1', _onEvent ); Reveal.off( 'state1', _onEvent );
}); });
} );
</script> </script>
</body> </body>

View File

@ -83,6 +83,8 @@
<script src="../dist/reveal.js"></script> <script src="../dist/reveal.js"></script>
<script> <script>
QUnit.config.testTimeout = 30000;
window.location.hash = ''; window.location.hash = '';
Reveal.configure({maxScale: 1.11}); Reveal.configure({maxScale: 1.11});