Skip to content

Commit

Permalink
Test for a token in the new format
Browse files Browse the repository at this point in the history
  • Loading branch information
lerouxb committed May 5, 2022
1 parent 5626db2 commit 6449e25
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
},
"license": "SSPL",
"dependencies": {
"bson": "^4.5.1"
"bson": "^4.6.3"
},
"devDependencies": {
"@types/mocha": "^8.0.3",
Expand Down
14 changes: 14 additions & 0 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,18 @@ describe('decodeResumeToken', function() {
documentKey: null
});
});

// See PM-1950
it('can decode new resume tokens', async() => {
const decoded = decodeResumeToken('826273BCD2000000012B022C0100296E5A1004808BBE9298B0403286C29EA48C4E162846645F696400646273BCD27257D30393BB73F70004');
assert.deepStrictEqual(decoded, {
timestamp: new bson.Timestamp({ t: 1651752146, i: 1 }),
version: 1,
tokenType: 128,
txnOpIndex: 0,
fromInvalidate: false,
uuid: new bson.UUID('808bbe92-98b0-4032-86c2-9ea48c4e1628'),
documentKey: { _id: new bson.ObjectId('6273bcd27257d30393bb73f7') }
});
});
});

0 comments on commit 6449e25

Please sign in to comment.