Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@rtspecialty.com>2019-09-18 11:18:16 -0400
committerMike Gerwitz <mike.gerwitz@rtspecialty.com>2019-10-18 09:55:10 -0400
commit5b279f77cb28dd68150d56f3445a576e838d8fa0 (patch)
tree965c86d9faf0353d7733ab25836ed0db6b45e1d6 /test
parent4454e40e19b45b08546e9e1081357ccfc1affd05 (diff)
downloadliza-5b279f77cb28dd68150d56f3445a576e838d8fa0.tar.gz
liza-5b279f77cb28dd68150d56f3445a576e838d8fa0.tar.bz2
liza-5b279f77cb28dd68150d56f3445a576e838d8fa0.zip
TokenDao (#updateToken): Return updated data
Since some of these data are generated within TokenDao (e.g. the timestamp), the caller cannot infer all values. * src/server/token/MongoTokenDao.ts (updateToken): Return Promise<{void=>TokenData}>. * src/server/token/TokenDao.ts (TokenDao)[#updateToken]: Update interface accordingly. * test/server/token/MongoTokenDaoTest.ts: Update test accordingly.
Diffstat (limited to 'test')
-rw-r--r--test/server/token/MongoTokenDaoTest.ts13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/server/token/MongoTokenDaoTest.ts b/test/server/token/MongoTokenDaoTest.ts
index 8fe0dff..5af032c 100644
--- a/test/server/token/MongoTokenDaoTest.ts
+++ b/test/server/token/MongoTokenDaoTest.ts
@@ -88,8 +88,17 @@ describe( 'server.token.TokenDao', () =>
findOne() {},
};
- return new Sut( coll, field, () => timestamp )
- .updateToken( did, ns, tok_id, tok_type, data );
+ return expect(
+ new Sut( coll, field, () => timestamp )
+ .updateToken( did, ns, tok_id, tok_type, data )
+ ).to.eventually.deep.equal( {
+ id: tok_id,
+ status: {
+ type: tok_type,
+ timestamp: timestamp,
+ data: data,
+ },
+ } );
} );