Skip to content

Commit

Permalink
test(cu): updates tests to consider blockHeight
Browse files Browse the repository at this point in the history
  • Loading branch information
TillaTheHun0 committed Dec 20, 2023
1 parent de8f981 commit 957f99e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions servers/cu/src/domain/client/pouchdb.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ describe('pouchdb', () => {
{
_id: 'eval-process-123,1702677252111',
timestamp: 1702677252111,
blockHeight: 1234,
processId: 'process-123',
messageId: 'message-123',
parent: 'proc-process-123',
Expand All @@ -197,6 +198,7 @@ describe('pouchdb', () => {
})

assert.equal(res.timestamp, 1702677252111)
assert.equal(res.blockHeight, 1234)
assert.equal(res.processId, 'process-123')
assert.deepStrictEqual(res.output, { Memory, Messages: [{ foo: 'bar' }] })
assert.equal(res.evaluatedAt.toISOString(), evaluatedAt)
Expand Down Expand Up @@ -225,6 +227,7 @@ describe('pouchdb', () => {
{
_id: 'eval-process-123,1702677252111',
timestamp: 1702677252111,
blockHeight: 1234,
processId: 'process-123',
messageId: 'message-123',
parent: 'proc-process-123',
Expand All @@ -250,6 +253,7 @@ describe('pouchdb', () => {
})

assert.equal(res.timestamp, 1702677252111)
assert.equal(res.blockHeight, 1234)
assert.equal(res.processId, 'process-123')
assert.deepStrictEqual(res.output, { Memory, Messages: [{ foo: 'bar' }] })
assert.equal(res.evaluatedAt.toISOString(), evaluatedAt)
Expand Down Expand Up @@ -288,6 +292,7 @@ describe('pouchdb', () => {
_id: 'eval-process-123,1702677252111',
cron: undefined,
timestamp: 1702677252111,
blockHeight: 1234,
processId: 'process-123',
messageId: 'message-123',
parent: 'proc-process-123',
Expand Down Expand Up @@ -324,6 +329,7 @@ describe('pouchdb', () => {
await saveEvaluation({
deepHash: 'deepHash-123',
timestamp: 1702677252111,
blockHeight: 1234,
processId: 'process-123',
messageId: 'message-123',
output: { Memory, Messages: [{ foo: 'bar' }] },
Expand All @@ -350,6 +356,7 @@ describe('pouchdb', () => {
await saveEvaluation({
// no deep hash
timestamp: 1702677252111,
blockHeight: 1234,
processId: 'process-123',
messageId: 'message-123',
output: { Memmory, Messages: [{ foo: 'bar' }] },
Expand All @@ -364,6 +371,7 @@ describe('pouchdb', () => {
const mockEval = {
_id: 'eval-process-123,1702677252111',
timestamp: 1702677252111,
blockHeight: 1234,
processId: 'process-123',
messageId: 'message-123',
parent: 'proc-process-123',
Expand All @@ -379,7 +387,7 @@ describe('pouchdb', () => {
selector: {
_id: {
$gte: 'eval-process-123,',
$lte: `eval-process-123,${COLLATION_SEQUENCE_MAX_CHAR}`
$lt: `eval-process-123,${COLLATION_SEQUENCE_MAX_CHAR}`
}
},
sort: [{ _id: 'asc' }],
Expand All @@ -406,6 +414,7 @@ describe('pouchdb', () => {
const mockEval = {
_id: 'eval-process-123,1702677252111',
timestamp: 1702677252111,
blockHeight: 1234,
processId: 'process-123',
messageId: 'message-123',
parent: 'process-123',
Expand All @@ -421,7 +430,7 @@ describe('pouchdb', () => {
selector: {
_id: {
$gte: 'eval-process-123,1702677252111,',
$lte: `eval-process-123,1702677252111,${COLLATION_SEQUENCE_MAX_CHAR}`
$lt: 'eval-process-123,1702677252111,'
}
},
sort: [{ _id: 'asc' }],
Expand Down
1 change: 1 addition & 0 deletions servers/cu/src/domain/lib/gatherCronOutboxes.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ describe('gatherCronOutboxesWith', () => {
processId: 'process-123',
messageId: 'message-123',
timestamp: new Date().getTime(),
blockHeight: 1234,
evaluatedAt: new Date()
}
const FROM = 1702841577654
Expand Down

0 comments on commit 957f99e

Please sign in to comment.