Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAustin Schaffer <austin.schaffer@ryansg.com>2020-01-15 10:26:40 -0500
committerAustin Schaffer <austin.schaffer@ryansg.com>2020-01-15 10:26:40 -0500
commit09a84e7cafeb27e4efeab40dd074c8cac70279ed (patch)
tree4040b54ed2fcca543abffd922cfb9a856cd14568 /test
parentd918d56a7eb6e553c319dca14ee613be32d38ee8 (diff)
parent61b66c24a3a535ece0e26afc7a7cbe5fa22cfcd0 (diff)
downloadliza-09a84e7cafeb27e4efeab40dd074c8cac70279ed.tar.gz
liza-09a84e7cafeb27e4efeab40dd074c8cac70279ed.tar.bz2
liza-09a84e7cafeb27e4efeab40dd074c8cac70279ed.zip
Pass along information about whether a save step was the last one
Diffstat (limited to 'test')
-rw-r--r--test/client/transport/XhttpQuoteTransportTest.js7
-rw-r--r--test/server/service/RatingServiceTest.ts1
-rw-r--r--test/system/DeltaProcessorTest.ts21
-rw-r--r--test/system/V1MessageWriterTest.ts30
4 files changed, 35 insertions, 24 deletions
diff --git a/test/client/transport/XhttpQuoteTransportTest.js b/test/client/transport/XhttpQuoteTransportTest.js
index 0401d24..0bfdd7f 100644
--- a/test/client/transport/XhttpQuoteTransportTest.js
+++ b/test/client/transport/XhttpQuoteTransportTest.js
@@ -58,6 +58,8 @@ describe( "XhttpQuoteTransport", () =>
bs: [ null ],
};
+ const concluding_save = true;
+
const stub_quote = { visitData: c => c( bucket ) };
const mock_proxy = {
@@ -66,10 +68,13 @@ describe( "XhttpQuoteTransport", () =>
expect( JSON.parse( data.data ) )
.to.deep.equal( expected_data );
+ expect( JSON.parse( data.concluding_save ) )
+ .to.deep.equal( concluding_save );
+
done();
},
};
- Sut( '', mock_proxy ).send( stub_quote );
+ Sut( '', mock_proxy, concluding_save ).send( stub_quote );
} );
} );
diff --git a/test/server/service/RatingServiceTest.ts b/test/server/service/RatingServiceTest.ts
index 546118c..016d75f 100644
--- a/test/server/service/RatingServiceTest.ts
+++ b/test/server/service/RatingServiceTest.ts
@@ -468,6 +468,7 @@ function getStubs()
data: {
_unavailable_all: [ undefined ]
},
+ concluding_save: false,
timestamp: 123
}
};
diff --git a/test/system/DeltaProcessorTest.ts b/test/system/DeltaProcessorTest.ts
index e4a54d4..485af31 100644
--- a/test/system/DeltaProcessorTest.ts
+++ b/test/system/DeltaProcessorTest.ts
@@ -459,9 +459,10 @@ describe( 'system.DeltaProcessor', () =>
rdelta: {
data: [
{
- data: { foo: [ 'first_bar' ] },
- timestamp: <UnixTimestamp>123123,
- type: 'data',
+ data: { foo: [ 'first_bar' ] },
+ timestamp: <UnixTimestamp>123123,
+ type: 'data',
+ concluding_save: false,
}
],
ratedata: [],
@@ -583,9 +584,10 @@ describe( 'system.DeltaProcessor', () =>
rdelta: {
data: [
{
- data: { foo: [ 'first_bar' ] },
- timestamp: <UnixTimestamp>123123,
- type: 'data',
+ data: { foo: [ 'first_bar' ] },
+ timestamp: <UnixTimestamp>123123,
+ type: 'data',
+ concluding_save: false,
}
],
ratedata: [],
@@ -603,9 +605,10 @@ describe( 'system.DeltaProcessor', () =>
rdelta: {
data: [
{
- data: { foo: [ 'first_bar' ] },
- timestamp: <UnixTimestamp>123123,
- type: 'data',
+ data: { foo: [ 'first_bar' ] },
+ timestamp: <UnixTimestamp>123123,
+ type: 'data',
+ concluding_save: false,
}
],
ratedata: [],
diff --git a/test/system/V1MessageWriterTest.ts b/test/system/V1MessageWriterTest.ts
index 2debf9d..210fd22 100644
--- a/test/system/V1MessageWriterTest.ts
+++ b/test/system/V1MessageWriterTest.ts
@@ -189,17 +189,12 @@ describe( 'system.V1MessageWriter', () =>
if ( valid )
{
- // return expect( result ).to.eventually.deep.equal(
- // Buffer.from( '' )
- // )
- // .then( b =>
- // {
- // expect( typeof(b) ).to.equal( 'object' );
- // } );
- return result.catch( e =>
+ return expect( result ).to.eventually.deep.equal(
+ Buffer.from( '' )
+ )
+ .then( b =>
{
- console.log( 'avroerror: ', e );
- expect.fail();
+ expect( typeof(b) ).to.equal( 'object' );
} );
}
else
@@ -396,9 +391,10 @@ describe( 'system.V1MessageWriter', () =>
};
const delta = <Delta<any>>{
- type: <DeltaType>'data',
- timestamp: <UnixTimestamp>123123123,
- data: <DeltaResult<any>>{},
+ type: <DeltaType>'data',
+ timestamp: <UnixTimestamp>123123123,
+ data: <DeltaResult<any>>{},
+ concluding_save: true,
};
const expected = {
@@ -406,7 +402,13 @@ describe( 'system.V1MessageWriter', () =>
id: 'STEP_SAVE',
ts: ts * 1000,
actor: 'SERVER',
- step: null,
+ step: {
+ EventStep: {
+ transition: 'END',
+ src: '',
+ dest: '',
+ },
+ },
},
document: {
id: doc_id,