mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-12-04 02:28:14 +00:00
27f964e240
Bug: T270240 Change-Id: If1a2530e428122713277fbe87cd015cb729ab550 Depends-On: I2ba889e1a5dd03549d8d7cb00678a30882ff03fe
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
'use strict';
|
|
|
|
const assert = require( 'assert' ),
|
|
EditPage = require( '../pageobjects/edit.page' ),
|
|
FeatureFlag = require( '../highlightingfeatureflag' ),
|
|
FixtureContent = require( '../fixturecontent' ),
|
|
LoginPage = require( 'wdio-mediawiki/LoginPage' ),
|
|
UserPreferences = require( '../userpreferences' );
|
|
|
|
describe( 'CodeMirror bracket match highlighting for the wikitext 2010 editor', function () {
|
|
before( function () {
|
|
LoginPage.loginAdmin();
|
|
this.title = FixtureContent.createFixturePage();
|
|
UserPreferences.enableWikitext2010EditorWithCodeMirror();
|
|
FeatureFlag.enable();
|
|
} );
|
|
|
|
beforeEach( function () {
|
|
EditPage.openForEditing( this.title );
|
|
EditPage.wikiEditorToolbar.waitForDisplayed();
|
|
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(), '{}' );
|
|
} );
|
|
} );
|