Files
mtusi2026lab2/bruno/messages/history-first-page.bru
T
2026-10-09 15:48:03 +03:00

41 lines
1.0 KiB
Plaintext

meta {
name: History first page
type: http
seq: 3
}
get {
url: {{baseUrl}}/api/v1/chats/{{chatId}}/messages?limit=1
body: none
auth: none
}
headers {
Authorization: Bearer {{secondToken}}
}
docs {
Keyset-пагинация по (created_at, id) по возрастанию. История читается
любой действующей сессией участника — здесь второй сессией, что заодно
показывает read-after-write для ранее отправленного сообщения.
Сохраняет nextCursor.
}
tests {
test("200 ok", function() {
expect(res.status).to.equal(200);
});
test("страница ограничена limit", function() {
expect(res.body.items.length).to.equal(1);
});
test("есть курсор на следующую страницу", function() {
expect(res.body.next_cursor).to.be.a("string");
});
}
script:post-response {
bru.setVar("nextCursor", res.body.next_cursor);
}