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

28 lines
801 B
JavaScript

'use strict';
const { action, assert } = require( 'api-testing' );
describe( 'Testing a new talk page notification', function () {
let kam = action.getAnon();
let alice;
before( async () => {
[ alice, kam ] = await Promise.all( [
action.alice(),
kam.account( 'Kam_' )
] );
} );
it( 'should edit a user\'s talk page', async () => {
await alice.edit( `User_talk:${kam.username}`, { text: 'Hi, Kam! ~~~~', summary: 'saying hello', createonly: true } );
} );
it( 'user should have a new message notification', async () => {
// FIXME: https://phabricator.wikimedia.org/T230211
const result = await kam.meta( 'userinfo', { uiprop: 'hasmsg' } );
assert.exists( result.messages );
assert.equal( result.name, kam.username );
assert.equal( result.id, kam.userid );
} );
} );