wiki.techinc.nl/tests/api-testing/action/ReparseDependentPages.js
Ed Sanders 8b720e9bd6 eslint: Update to eslint-config-wikimedia 0.16.0
* valid-jsdoc replaced with jsdoc plugin
* New /selenium config

Change-Id: I471eebac0312cb25c539c3f6a3ecfc7cfd4ed8d6
2020-06-02 21:32:56 +01:00

38 lines
1.2 KiB
JavaScript

'use strict';
const { action, assert, utils } = require( 'api-testing' );
describe( 'Reparse of dependent pages', function () {
const title = utils.title( 'Reparse_' );
const template = utils.title( 'Template' );
const link = utils.title( 'Link' );
let alice;
before( async () => {
alice = await action.alice();
} );
it( 'should create a page with missing template and link', async () => {
await alice.edit( title, { text: `{{${template}}} [[${link}]]`, createonly: true } );
const html = await alice.getHtml( title );
assert.match( html, new RegExp( `title=Template:${template}&action=edit&redlink=1` ) );
assert.match( html, new RegExp( `title=${link}&action=edit&redlink=1` ) );
} );
it( 'should create missing template and link', async () => {
await alice.edit( `Template:${template}`, { text: 'Howdy', createonly: true } );
await alice.edit( link, { text: 'Test link', createonly: true } );
} );
// FIXME: T230211
it.skip( 'should get page with updated template and link', async function () {
const { parse } = await alice.action( 'parse', { page: title } );
assert.notInclude( parse.text[ '*' ], 'redlink=1' );
assert.exists( parse.links[ 0 ].exists );
assert.exists( parse.templates[ 0 ].exists );
} );
} );