mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-12-24 19:43:16 +00:00
4bb409887d
Includes a bit untangling of the setup. Concurrent tests should not overwrite each others user settings so one of the tests gets it's own user. Bug: T337862 Change-Id: Iae245063932d4c5d9e6b61c1fe102505d70c1039
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', function () {
|
|
let title;
|
|
|
|
before( async function () {
|
|
title = Util.getTestString( 'CodeMirror-fixture1-' );
|
|
await UserPreferences.loginAsOther();
|
|
await FixtureContent.createFixturePage( title );
|
|
await UserPreferences.enableWikitext2010EditorWithCodeMirror();
|
|
} );
|
|
|
|
beforeEach( async function () {
|
|
await EditPage.openForEditing( title );
|
|
await EditPage.wikiEditorToolbar.waitForDisplayed();
|
|
await EditPage.clickText();
|
|
} );
|
|
|
|
it( 'highlights matching bracket', async function () {
|
|
await EditPage.cursorToPosition( 0 );
|
|
assert.strictEqual( await EditPage.getHighlightedMatchingBrackets(), '[]' );
|
|
} );
|
|
|
|
it( 'matches according to cursor movement', async function () {
|
|
await EditPage.cursorToPosition( 3 );
|
|
assert.strictEqual( await EditPage.getHighlightedMatchingBrackets(), '{}' );
|
|
} );
|
|
} );
|