wiki.techinc.nl/tests/api-testing/action/Autopatrolling.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

32 lines
1 KiB
JavaScript

'use strict';
const { assert, action, utils } = require( 'api-testing' );
describe( 'Testing default autopatrolling rights', function () {
const anonymousUser = action.getAnon();
let title, mindy;
before( async () => {
title = await utils.title( 'Autopatrol_' );
mindy = await action.mindy();
} );
it( 'should edit page as a user in autopatrol group', async () => {
await mindy.edit( title, { text: 'Is this page autopatrolled?' } );
} );
it( 'should edit page as an anonymous user', async () => {
await anonymousUser.edit( title, { text: 'Anonymous: Is this page autopatrolled?' } );
} );
it( 'should confirm autopatrolling rights', async () => {
const anonUserInfo = await anonymousUser.meta( 'userinfo', {} );
const result = await mindy.list( 'recentchanges', { rctitle: title, rcprop: 'patrolled|user' } );
assert.lengthOf( result, 2 );
assert.sameDeepMembers( result, [
{ anon: '', type: 'edit', unpatrolled: '', user: anonUserInfo.name },
{ type: 'new', patrolled: '', autopatrolled: '', user: mindy.username }
] );
} );
} );