Skip to content
Snippets Groups Projects
Commit 6b8195ef authored by bpresles's avatar bpresles
Browse files

Added integration tests for transaction history and transaction history with times filters

parent c55d3370
Branches
No related tags found
1 merge request!1276[fix] #1350 Time of transactions not being saved on SQLite table
...@@ -22,6 +22,9 @@ const assert = require('assert'); ...@@ -22,6 +22,9 @@ const assert = require('assert');
describe("Testing transactions", function() { describe("Testing transactions", function() {
const now = 1490000000; const now = 1490000000;
const yesterday = now - 86400;
const tomorrow = now + 86400;
const intwodays = now + (86400 * 2);
let s1:TestingServer, tic:TestUser, toc:TestUser let s1:TestingServer, tic:TestUser, toc:TestUser
...@@ -77,6 +80,27 @@ describe("Testing transactions", function() { ...@@ -77,6 +80,27 @@ describe("Testing transactions", function() {
]) ])
}) })
describe("History by time", function(){
it('should have a time not null', () => s1.expect('/tx/history/DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo', (res:any) => {
res.should.have.property('pubkey').equal('DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo');
res.should.have.property('history').property('received').length(1);
res.history.received[0].should.have.property('time').not.be.Null;
res.history.received[0].should.have.property('time').be.a.Number;
}));
it('should return a received transaction between yesterday and tomorrow', () => s1.expect('/tx/history/DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo/times/' + yesterday + '/' + tomorrow, (res:any) => {
res.should.have.property('pubkey').equal('DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo');
res.should.have.property('history').property('received').length(1);
res.history.received[0].should.have.property('time').not.be.Null;
res.history.received[0].should.have.property('time').be.a.Number;
}));
it('should not return a received transaction the day after tomorrow', () => s1.expect('/tx/history/DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo/times/' + tomorrow + '/' + intwodays, (res:any) => {
res.should.have.property('pubkey').equal('DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo');
res.should.have.property('history').property('received').length(0);
}));
})
describe("Sources", function(){ describe("Sources", function(){
it('it should exist block#2 with UD of 1200', () => s1.expect('/blockchain/block/2', (block:any) => { it('it should exist block#2 with UD of 1200', () => s1.expect('/blockchain/block/2', (block:any) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment