wiki.techinc.nl/tests/api-testing/action/NewTalkNotification.js
Clara Andrew-Wani f07d7ba699 Move tests from api-testing repo into Core
Except for Search & Watchlist, which need fixes in gated extensions first.

Change-Id: I88d24dda4bc047868de3ff9dd4a5753b9c7b0f64
2020-02-05 16:07:54 -08:00

26 lines
786 B
JavaScript

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 );
} );
} );