Fix oplog converter case in which there is no need to convert - new test

This commit is contained in:
Renan Castro
2022-01-06 21:03:56 -03:00
committed by Filipe Névola
parent 316f5d4512
commit 34d25f181d

View File

@@ -35,6 +35,8 @@ Tinytest.only('oplog - v2/v1 conversion', function(test) {
const entry9 = {"$v":2,"diff":{"sservices":{"sresume":{"u":{"loginTokens":[]}}}}};
const entry10 = {"$v":2,"$set":{"services.resume.loginTokens":[{"when":"2022-01-06T23:58:35.704Z","hashedToken":"RlalW6ZSvPPJLH6sW3B1b+vrUnPy+Ox5oMv3O3S7jwg="},{"when":"2022-01-06T23:58:35.704Z","hashedToken":"DWG0Qw/+nZ48wAIhKR2r9H41wLpth9BM+Br6aZsl2bU="}]}};
test.equal(
JSON.stringify(oplogV2V1Converter(entry1)),
JSON.stringify({
@@ -80,4 +82,8 @@ Tinytest.only('oplog - v2/v1 conversion', function(test) {
JSON.stringify(oplogV2V1Converter(entry9)),
JSON.stringify({ '$v': 2, '$set': { 'services.resume.loginTokens': [] } })
);
test.equal(
JSON.stringify(oplogV2V1Converter(entry10)),
JSON.stringify( {"$v":2,"$set":{"services.resume.loginTokens":[{"when":"2022-01-06T23:58:35.704Z","hashedToken":"RlalW6ZSvPPJLH6sW3B1b+vrUnPy+Ox5oMv3O3S7jwg="},{"when":"2022-01-06T23:58:35.704Z","hashedToken":"DWG0Qw/+nZ48wAIhKR2r9H41wLpth9BM+Br6aZsl2bU="}]}})
);
});