}
})
+ it('Should search blocked accounts', async function () {
+ const body = await command.listMyAccountBlocklist({ start: 0, count: 10, search: 'user2' })
+ expect(body.total).to.equal(1)
+
+ expect(body.data[0].blockedAccount.name).to.equal('user2')
+ })
+
it('Should get blocked status', async function () {
const remoteHandle = 'user2@' + servers[1].host
const localHandle = 'user1@' + servers[0].host
expect(block.blockedServer.host).to.equal('localhost:' + servers[1].port)
})
+ it('Should search blocked servers', async function () {
+ const body = await command.listMyServerBlocklist({ start: 0, count: 10, search: servers[1].host })
+ expect(body.total).to.equal(1)
+
+ expect(body.data[0].blockedServer.host).to.equal(servers[1].host)
+ })
+
it('Should get blocklist status', async function () {
const blockedServer = servers[1].host
const notBlockedServer = 'example.com'
}
})
+ it('Should search blocked accounts', async function () {
+ const body = await command.listServerAccountBlocklist({ start: 0, count: 10, search: 'user2' })
+ expect(body.total).to.equal(1)
+
+ expect(body.data[0].blockedAccount.name).to.equal('user2')
+ })
+
it('Should get blocked status', async function () {
const remoteHandle = 'user2@' + servers[1].host
const localHandle = 'user1@' + servers[0].host
expect(block.blockedServer.host).to.equal('localhost:' + servers[1].port)
})
+ it('Should search blocked servers', async function () {
+ const body = await command.listServerServerBlocklist({ start: 0, count: 10, search: servers[1].host })
+ expect(body.total).to.equal(1)
+
+ expect(body.data[0].blockedServer.host).to.equal(servers[1].host)
+ })
+
it('Should get blocklist status', async function () {
const blockedServer = servers[1].host
const notBlockedServer = 'example.com'
type ListBlocklistOptions = OverrideCommandOptions & {
start: number
count: number
- sort: string // default -createdAt
+
+ sort?: string // default -createdAt
+
+ search?: string
}
export class BlocklistCommand extends AbstractCommand {
}
private listBlocklist <T> (options: ListBlocklistOptions, path: string) {
- const { start, count, sort = '-createdAt' } = options
+ const { start, count, search, sort = '-createdAt' } = options
return this.getRequestBody<ResultList<T>>({
...options,
path,
- query: { start, count, sort },
+ query: { start, count, sort, search },
implicitToken: true,
defaultExpectedStatus: HttpStatusCode.OK_200
})