blob: 85a45db54d4c0444c19d2f5bec298fa8f83d2fa0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
'use strict';
const { action, assert, utils } = require( 'api-testing' );
describe( 'Backlinks', function () {
const randomPage = utils.title( 'Esther' );
const linksToEsther1 = utils.title( 'LinksToEsther1' );
const linksToEsther2 = utils.title( 'LinksToEsther2' );
let bob;
before( async () => {
bob = await action.bob();
const randomPageText = `I'm guessing you came here from ${linksToEsther1} or ${linksToEsther2}.`;
const text = `All I do is link to [[${randomPage}|Page]]`;
await bob.edit( linksToEsther1, { text } );
await bob.edit( linksToEsther2, { text } );
await bob.edit( randomPage, { text: randomPageText } );
} );
describe( 'referrers', () => {
it( 'can be listed', async () => {
const result = await bob.list( 'backlinks', { bltitle: randomPage } );
const links = result.map( ( p ) => p.title );
assert.sameMembers( links, [ linksToEsther1, linksToEsther2 ] );
} );
} );
} );
|