+ it('Should get blocked status', async function () {
+ const remoteHandle = 'user2@' + servers[1].host
+ const localHandle = 'user1@' + servers[0].host
+ const unknownHandle = 'user5@' + servers[0].host
+
+ {
+ const status = await command.getStatus({ accounts: [ remoteHandle ] })
+ expect(Object.keys(status.accounts)).to.have.lengthOf(1)
+ expect(status.accounts[remoteHandle].blockedByUser).to.be.false
+ expect(status.accounts[remoteHandle].blockedByServer).to.be.false
+
+ expect(Object.keys(status.hosts)).to.have.lengthOf(0)
+ }
+
+ {
+ const status = await command.getStatus({ token: servers[0].accessToken, accounts: [ remoteHandle ] })
+ expect(Object.keys(status.accounts)).to.have.lengthOf(1)
+ expect(status.accounts[remoteHandle].blockedByUser).to.be.true
+ expect(status.accounts[remoteHandle].blockedByServer).to.be.false
+
+ expect(Object.keys(status.hosts)).to.have.lengthOf(0)
+ }
+
+ {
+ const status = await command.getStatus({ token: servers[0].accessToken, accounts: [ localHandle, remoteHandle, unknownHandle ] })
+ expect(Object.keys(status.accounts)).to.have.lengthOf(3)
+
+ for (const handle of [ localHandle, remoteHandle ]) {
+ expect(status.accounts[handle].blockedByUser).to.be.true
+ expect(status.accounts[handle].blockedByServer).to.be.false
+ }
+
+ expect(status.accounts[unknownHandle].blockedByUser).to.be.false
+ expect(status.accounts[unknownHandle].blockedByServer).to.be.false
+
+ expect(Object.keys(status.hosts)).to.have.lengthOf(0)
+ }
+ })
+