describe( 'wpcom.site.statsPublicize', function () { it( 'should request publicize data', ( done ) => { site .statsPublicize() .then( ( data ) => { assert.equal( 'string', typeof Date( data.day ) ); assert.ok( data.services instanceof Array ); done(); } ) .catch( done ); } ); } );
describe( 'wpcom.site.post.comment.like.delete', function () { it( 'should remove your like from the comment', function ( done ) { testing_comment.like().del( function ( err, data ) { if ( err ) throw err; assert.ok( data ); assert.ok( data.success ); assert.equal( 0, data.like_count ); assert.ok( ! data.i_like ); done(); } ); } ); } );
describe( 'wpcom.site.post.comment.reply', function () { it( 'should add a reply to a post comment', function ( done ) { testing_comment.reply( fixture.post_comment + '-replied', function ( err, data ) { if ( err ) throw err; assert.equal( 'number', typeof data.ID ); assert.equal( 'object', typeof data.post ); assert.ok( data.post instanceof Object ); assert.equal( testing_comment._cid, data.parent.ID ); done(); } ); } ); } );
describe( 'wpcom.site.post.comments', function () { it( 'should get the post comments list', function ( done ) { testing_post.comments( function ( err, data ) { if ( err ) throw err; assert.equal( 'number', typeof data.found ); assert.equal( 'object', typeof data.comments ); assert.ok( data.comments instanceof Array ); done(); } ); } ); } );
describe( 'wpcom.site.media.get', function () { it( 'should get added media', ( done ) => { const media = site.media( testing_media.ID ); media .get() .then( ( data ) => { assert.equal( testing_media.ID, data.ID ); done(); } ) .catch( done ); } ); } );
describe( 'wpcom.site.post.comment.like.add', function () { it( 'should add a comment like', function ( done ) { testing_comment.like().add( function ( err, data ) { if ( err ) throw err; assert.ok( data ); assert.equal( 1, data.like_count ); assert.ok( data.i_like ); done(); } ); } ); } );
describe( 'wpcom.site.media.delete', function () { it( 'should delete a media', ( done ) => { site .media( testing_media.ID ) .del() .then( ( data ) => { assert.equal( testing_media.ID, data.ID ); done(); } ) .catch( done ); } ); } );
describe( 'wpcom.site.post.comment.add', function () { it( 'should add a post comment', function ( done ) { testing_comment.add( fixture.post_comment + '-added', function ( err, data ) { if ( err ) throw err; assert.equal( 'number', typeof data.ID ); assert.equal( 'object', typeof data.post ); assert.ok( data.post instanceof Object ); done(); } ); } ); } );
describe( 'wpcom.site.usersList', function () { it( 'should request users list', ( done ) => { site .usersList() .then( ( list ) => { assert.equal( 'number', typeof list.found ); assert.ok( list.users instanceof Array ); done(); } ) .catch( done ); } ); } );
describe( 'wpcom.site.post.comment.update', function () { it( 'should update a post comment', function ( done ) { testing_comment.update( fixture.post_comment + '-updated', function ( err, data ) { if ( err ) throw err; assert.equal( 'number', typeof data.ID ); assert.equal( 'object', typeof data.post ); assert.ok( data.post instanceof Object ); assert.equal( testing_comment._cid, data.ID ); done(); } ); } ); } );
describe( 'wpcom.site.statsTags', function () { it( 'should request tag data', ( done ) => { site .statsTags() .then( ( data ) => { assert.equal( 'string', typeof Date( data.day ) ); assert.ok( data.tags instanceof Array ); done(); } ) .catch( done ); } ); } );
describe( 'wpcom.site.post.comment.like.mine', function () { it( 'should get the comment like status of mine', function ( done ) { testing_comment.like().mine( function ( err, data ) { if ( err ) throw err; assert.ok( data ); assert.equal( 1, data.like_count ); assert.ok( data.i_like ); done(); } ); } ); } );
describe( 'wpcom.site.statsStreak', function () { it( 'should request streak data', ( done ) => { site .statsStreak() .then( ( data ) => { assert.equal( 'string', typeof Date( data.day ) ); assert.ok( data.streak instanceof Object ); done(); } ) .catch( done ); } ); } );