forked from mtusi2026/mtusi2026lab2
feat: lab2 done
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user