add getSlidePath API method, update URL tests to work with new replaceState throttle
This commit is contained in:
@ -341,38 +341,38 @@
|
||||
Reveal.configure({ hash: true, fragmentInURL: false });
|
||||
|
||||
Reveal.slide( 2, 0 );
|
||||
assert.strictEqual( window.location.hash, '#/2' );
|
||||
assert.strictEqual( Reveal.getSlidePath(), '/2' );
|
||||
|
||||
Reveal.slide( 2, 1 );
|
||||
assert.strictEqual( window.location.hash, '#/2/1' );
|
||||
assert.strictEqual( Reveal.getSlidePath(), '/2/1' );
|
||||
|
||||
Reveal.slide( 2, 0, 1 );
|
||||
assert.strictEqual( window.location.hash, '#/2' );
|
||||
assert.strictEqual( Reveal.getSlidePath(), '/2' );
|
||||
|
||||
Reveal.slide( 2, 2, 0 );
|
||||
assert.strictEqual( window.location.hash, '#/fragments3' );
|
||||
assert.strictEqual( Reveal.getSlidePath(), '/fragments3' );
|
||||
|
||||
Reveal.slide( 2, 2, 1 );
|
||||
assert.strictEqual( window.location.hash, '#/fragments3' );
|
||||
assert.strictEqual( Reveal.getSlidePath(), '/fragments3' );
|
||||
});
|
||||
|
||||
QUnit.test( 'Write (fragmentInURL: true)', function( assert ) {
|
||||
Reveal.configure({ hash: true, fragmentInURL: true });
|
||||
|
||||
Reveal.slide( 2, 0, -1 );
|
||||
assert.strictEqual( window.location.hash, '#/2' );
|
||||
assert.strictEqual( Reveal.getSlidePath(), '/2' );
|
||||
|
||||
Reveal.slide( 2, 1, -1 );
|
||||
assert.strictEqual( window.location.hash, '#/2/1' );
|
||||
assert.strictEqual( Reveal.getSlidePath(), '/2/1' );
|
||||
|
||||
Reveal.slide( 2, 0, 1 );
|
||||
assert.strictEqual( window.location.hash, '#/2/0/1' );
|
||||
assert.strictEqual( Reveal.getSlidePath(), '/2/0/1' );
|
||||
|
||||
Reveal.slide( 2, 2, -1 );
|
||||
assert.strictEqual( window.location.hash, '#/fragments3' );
|
||||
assert.strictEqual( Reveal.getSlidePath(), '/fragments3' );
|
||||
|
||||
Reveal.slide( 2, 2, 1 );
|
||||
assert.strictEqual( window.location.hash, '#/fragments3/1' );
|
||||
assert.strictEqual( Reveal.getSlidePath(), '/fragments3/1' );
|
||||
});
|
||||
|
||||
QUnit.test( 'Read', async function( assert ) {
|
||||
|
Reference in New Issue
Block a user