Skip to content

Commit

Permalink
Add cursor to expected output
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaptic committed Dec 17, 2024
1 parent 106618e commit 5246da1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/unit/server/soroban/get_events_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ describe("Server#getEvents", function () {
});

it("requests the correct endpoint", function (done) {
let result = { latestLedger: 0, events: [] };
let result = {
cursor: "164090849041387521-3",
latestLedger: 0,
events: [],
};
setupMock(
this.axiosMock,
{
Expand All @@ -38,6 +42,7 @@ describe("Server#getEvents", function () {
it("can build wildcard filters", function (done) {
let result = {
latestLedger: 1,
cursor: "164090849041387521-3",
events: filterEvents(getEventsResponseFixture, "*/*"),
};
expect(result.events).to.not.have.lengthOf(0, JSON.stringify(result));
Expand Down Expand Up @@ -76,6 +81,7 @@ describe("Server#getEvents", function () {
it("can build matching filters", function (done) {
let result = {
latestLedger: 1,
cursor: "164090849041387521-3",
events: filterEvents(
getEventsResponseFixture,
`${topicVals[0]}/${topicVals[1]}`,
Expand Down Expand Up @@ -116,6 +122,7 @@ describe("Server#getEvents", function () {
it("can build mixed filters", function (done) {
let result = {
latestLedger: 3,
cursor: "164090849041387521-3",
events: filterEventsByLedger(
filterEvents(getEventsResponseFixture, `${topicVals[0]}/*`),
2,
Expand Down Expand Up @@ -156,6 +163,7 @@ describe("Server#getEvents", function () {
it("can paginate", function (done) {
let result = {
latestLedger: 3,
cursor: "164090849041387521-3",
events: filterEventsByLedger(
filterEvents(getEventsResponseFixture, "*/*"),
2,
Expand Down

0 comments on commit 5246da1

Please sign in to comment.