wiki.techinc.nl/tests/api-testing/action/ReparseDependentPages.js
Ed Sanders 4b9ccab9b9 ESLint: Enforce prefer-arrow-callback and autofix
Change-Id: Iddfa574e42e569ac5e2a2b098ad2f11ca80c5955
2024-06-11 19:03:54 +01:00

38 lines
1.2 KiB
JavaScript

'use strict';
const { action, assert, utils } = require( 'api-testing' );
describe( 'Reparse of dependent pages', () => {
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 () => {
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 );
} );
} );