mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-12-18 00:30:30 +00:00
6958b99f2e
Change-Id: I622f53bf5f56782b7a0529cdc6bb27c1315ff5a0
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' ),
|
|
UserPreferences = require( '../userpreferences' ),
|
|
Util = require( 'wdio-mediawiki/Util' );
|
|
|
|
describe( 'CodeMirror bracket match highlighting for the wikitext 2010 editor', () => {
|
|
let title;
|
|
|
|
before( async () => {
|
|
title = Util.getTestString( 'CodeMirror-fixture1-' );
|
|
await UserPreferences.loginAsOther();
|
|
await FixtureContent.createFixturePage( title );
|
|
await UserPreferences.enableWikitext2010EditorWithCodeMirror();
|
|
} );
|
|
|
|
beforeEach( async () => {
|
|
await EditPage.openForEditing( title );
|
|
await EditPage.wikiEditorToolbar.waitForDisplayed();
|
|
await EditPage.clickText();
|
|
} );
|
|
|
|
it( 'highlights matching bracket', async () => {
|
|
await EditPage.cursorToPosition( 0 );
|
|
assert.strictEqual( await EditPage.getHighlightedMatchingBrackets(), '[]' );
|
|
} );
|
|
|
|
it( 'matches according to cursor movement', async () => {
|
|
await EditPage.cursorToPosition( 3 );
|
|
assert.strictEqual( await EditPage.getHighlightedMatchingBrackets(), '{}' );
|
|
} );
|
|
} );
|