cc-tracking/tasks/archive/comcarde/bridge-901/checkin-summary.md
2019-05-21 16:40:16 +01:00

1.0 KiB

BRIDGE-901 Unit test decrypt-card.spec.js sometimes fails due to MS difference

Summary

The two objects TEST_ACCOUNT_DECRYPTED and TEST_ACCOUNT_ENCRYPTED were both created using new Date() to create the lastUpdated value.

TEST_ACCOUNT_ENCRYPTED = {
    ...
    LastUpdate: new Date(),
    ...
}

TEST_ACCOUNT_DECRYPTED = {
    ...
    LastUpdate: new Date(),
    ...
}


The new version has a lastUpdate created before the two objects are created, and the objects using that to ensure the dates match.

const lastUpdate = new Date();

TEST_ACCOUNT_ENCRYPTED = {
    ...
    LastUpdate: lastUpdate,
    ...
}

TEST_ACCOUNT_DECRYPTED = {
    ...
    LastUpdate: lastUpdate,
    ...
}


Test Plan

  • Run All tests
  • Run common.instrument.decrypt-card

Test Results


 common.instrument.decrypt-card
    ✓ it returns decrypted keys if instrument is valid
    ✓ it throws a "DECRYPTION_FAIL" HttpError if key is wrong
    ✓ it throws a "DECRYPTION_FAIL" HttpError if UserID is wrong


  3 passing (14ms)