wiki.techinc.nl/tests/api-testing/action/ReparseDependentPages.js
James D. Forrester c2aa05102d build: Upgrade eslint-config-wikimedia from 0.25.0 to 0.26.0 and make pass
Mostly this has a bunch of whitespace changes from the
template-curly-spacing and brace-style rules being set
to align with other spacing rules.

Change-Id: I4609c52a4ef426ad1f35fb4bfe447bb08323a8e8
2023-11-22 13:25:32 -05:00

38 lines
1.3 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 );
} );
} );