mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-12-12 15:35:11 +00:00
4734f69efb
Change-Id: I12572558a47824de284904bc24dd940281b689a9
55 lines
1.1 KiB
JavaScript
55 lines
1.1 KiB
JavaScript
'use strict';
|
|
|
|
const assert = require( 'assert' ),
|
|
DiffPage = require( '../pageobjects/diff.page' );
|
|
|
|
describe( 'RevisionSlider pointers', function () {
|
|
|
|
before( function () {
|
|
DiffPage.prepareSimpleTests( 3 );
|
|
} );
|
|
|
|
beforeEach( function () {
|
|
DiffPage.ready();
|
|
DiffPage.openSlider();
|
|
} );
|
|
|
|
afterEach( function () {
|
|
browser.refresh();
|
|
} );
|
|
|
|
it( ' can be dragged', function () {
|
|
assert(
|
|
DiffPage.isOlderPointerOn( 2 ),
|
|
'older pointer should be on previous revision'
|
|
);
|
|
assert(
|
|
DiffPage.isNewerPointerOn( 3 ),
|
|
'newer pointer should be on current revision'
|
|
);
|
|
|
|
DiffPage.dragOlderPointerTo( 1 );
|
|
DiffPage.waitUntilLoaded();
|
|
|
|
DiffPage.dragNewerPointerTo( 2 );
|
|
DiffPage.waitUntilLoaded();
|
|
|
|
assert(
|
|
DiffPage.isOlderPointerOn( 1 ),
|
|
'older pointer should be on revision 1'
|
|
);
|
|
assert(
|
|
DiffPage.isNewerPointerOn( 2 ),
|
|
'newer pointer should be on revision 2'
|
|
);
|
|
assert(
|
|
DiffPage.showsOlderSummary( 1 ),
|
|
'revision 1 should be loaded on the left of the diff'
|
|
);
|
|
assert(
|
|
DiffPage.showsNewerSummary( 2 ),
|
|
'revision 2 should be loaded on the right of the diff'
|
|
);
|
|
} );
|
|
} );
|