mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-12-22 02:22:41 +00:00
9f34c4d220
Bug: T307188 Change-Id: Ibb21dea29c87d8fac898506c19f329273348c190
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
'use strict';
|
|
|
|
const assert = require( 'assert' ),
|
|
EditPage = require( '../pageobjects/edit.page' ),
|
|
FixtureContent = require( '../fixturecontent' ),
|
|
LoginPage = require( 'wdio-mediawiki/LoginPage' ),
|
|
UserPreferences = require( '../userpreferences' );
|
|
|
|
describe( 'CodeMirror bracket match highlighting for the wikitext 2017 editor', function () {
|
|
before( function () {
|
|
LoginPage.loginAdmin();
|
|
this.title = FixtureContent.createFixturePage();
|
|
UserPreferences.enableWikitext2017EditorWithCodeMirror();
|
|
} );
|
|
|
|
beforeEach( function () {
|
|
EditPage.openForEditing( this.title );
|
|
EditPage.visualEditorSave.waitForDisplayed();
|
|
assert( !EditPage.wikiEditorToolbar.isDisplayed() );
|
|
EditPage.clickText();
|
|
} );
|
|
|
|
it( 'highlights matching bracket', function () {
|
|
EditPage.cursorToPosition( 0 );
|
|
assert.strictEqual( EditPage.getHighlightedMatchingBrackets(), '[]' );
|
|
} );
|
|
|
|
it( 'matches according to cursor movement', function () {
|
|
EditPage.cursorToPosition( 3 );
|
|
// FIXME: wait for hook to fire
|
|
browser.pause( 100 );
|
|
assert.strictEqual( EditPage.getHighlightedMatchingBrackets(), '{}' );
|
|
} );
|
|
} );
|