Skip to content

Commit

Permalink
another case
Browse files Browse the repository at this point in the history
  • Loading branch information
45930 committed Oct 23, 2024
1 parent 01f0a70 commit 5bc4124
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/services/actions-service/actions-service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,34 @@ describe('ActionsService', () => {
assert.strictEqual(sortedActions[1].accountUpdateId, '2');
});
});
describe('with account update ids that are ordered in non-ascending or descending order', () => {
const zkappAccountUpdateIds = [1, 3, 2];
before(() => {
actions = [
dummyAction({
sequenceNumber,
zkappAccountUpdateIds,
accountUpdateId: '2',
}),
dummyAction({
sequenceNumber,
zkappAccountUpdateIds,
accountUpdateId: '1',
}),
dummyAction({
sequenceNumber,
zkappAccountUpdateIds,
accountUpdateId: '3',
}),
];
});
test('it sorts actions by their account update index', () => {
const sortedActions = actionsService.sortActions(actions);
assert.strictEqual(sortedActions[0].accountUpdateId, '1');
assert.strictEqual(sortedActions[1].accountUpdateId, '3');
assert.strictEqual(sortedActions[2].accountUpdateId, '2');
});
});
});
});
});
Expand Down

0 comments on commit 5bc4124

Please sign in to comment.