Skip to content

Commit

Permalink
Merge pull request #172 from getyoti/release-3.10.1
Browse files Browse the repository at this point in the history
Release 3.10.1
  • Loading branch information
davidgrayston authored Jun 1, 2020
2 parents 73e5ce5 + a52e481 commit 4e15b13
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yoti",
"version": "3.10.0",
"version": "3.10.1",
"description": "Yoti NodeJS SDK for back-end integration",
"author": "Yoti LTD <[email protected]> (https://www.yoti.com/developers)",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sonar.projectKey = yoti-web-sdk:node
sonar.projectName = node-sdk
sonar.projectVersion = 3.10.0
sonar.projectVersion = 3.10.1
sonar.exclusions=tests/**,examples/**,node_modules/**,coverage/**
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.verbose = true
2 changes: 1 addition & 1 deletion src/data_type/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function formatDatePart(part, length) {
* @returns {number}
*/
function extractMicrosecondsFromDateString(dateString) {
const secondsFractionMatch = dateString.match(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.(\d+)[Z|+]/);
const secondsFractionMatch = dateString.match(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.(\d+)[Z|+|-]/);

if (secondsFractionMatch === null) {
return 0;
Expand Down
4 changes: 4 additions & 0 deletions tests/data_type/date.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ describe('YotiDate', () => {
['1920-03-13T19:50:53.000001Z', '1920-03-13T19:50:53.000001Z'],
['1920-03-13T19:50:53.999999Z', '1920-03-13T19:50:53.999999Z'],
['1920-03-13T19:50:53.000100Z', '1920-03-13T19:50:53.000100Z'],
['2006-01-02T22:04:05.123956+04:00', '2006-01-02T18:04:05.123956Z'],
['2006-01-02T22:04:05.654321-01:00', '2006-01-02T23:04:05.654321Z'],
['2006-01-02T22:04:05.654-01:00', '2006-01-02T23:04:05.654000Z'],
['2006-01-02T22:04:05-01:00', '2006-01-02T23:04:05.000000Z'],
])('%s should convert to RFC-3339 date/time %s', (dateString, expected) => {
expect(YotiDate.fromDateString(dateString).getMicrosecondTimestamp())
.toBe(expected);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('BreakdownResponse', () => {
});

describe('#getResult', () => {
it('should return result check', () => {
it('should return result', () => {
expect(breakdownResponse.getResult()).toBe('some-result');
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('DetailsResponse', () => {
});

describe('#getResult', () => {
it('should return result check', () => {
it('should return result', () => {
expect(detailsResponse.getValue()).toBe('some-value');
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const CheckResponse = require('../../../../src/doc_scan_service/session/retrieve
const AuthenticityCheckResponse = require('../../../../src/doc_scan_service/session/retrieve/authenticity.check.response');
const FaceMatchCheckResponse = require('../../../../src/doc_scan_service/session/retrieve/face.match.check.response');
const TextDataCheckResponse = require('../../../../src/doc_scan_service/session/retrieve/text.data.check.response');
const ZoomLivenessCheckResponse = require('../../../../src/doc_scan_service/session/retrieve/liveness.check.response');
const LivenessCheckResponse = require('../../../../src/doc_scan_service/session/retrieve/liveness.check.response');
const ResourceContainer = require('../../../../src/doc_scan_service/session/retrieve/resource.container');

const ID_DOCUMENT_AUTHENTICITY = 'ID_DOCUMENT_AUTHENTICITY';
Expand Down Expand Up @@ -79,7 +79,7 @@ describe('GetSessionResult', () => {
const checks = session.getChecks();
expect(checks.length).toBe(4);
expect(checks[0]).toBeInstanceOf(AuthenticityCheckResponse);
expect(checks[1]).toBeInstanceOf(ZoomLivenessCheckResponse);
expect(checks[1]).toBeInstanceOf(LivenessCheckResponse);
expect(checks[2]).toBeInstanceOf(FaceMatchCheckResponse);
expect(checks[3]).toBeInstanceOf(TextDataCheckResponse);
checks.forEach(check => expect(check).toBeInstanceOf(CheckResponse));
Expand Down Expand Up @@ -108,7 +108,7 @@ describe('GetSessionResult', () => {
it('should return array of ZoomLivenessCheckResponse', () => {
const checks = session.getLivenessChecks();
expect(checks.length).toBe(1);
expect(checks[0]).toBeInstanceOf(ZoomLivenessCheckResponse);
expect(checks[0]).toBeInstanceOf(LivenessCheckResponse);
expect(checks[0].getType()).toBe(LIVENESS);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('IdDocumentResourceResponse', () => {
});

describe('#getIssuingCountry', () => {
it('should return result check', () => {
it('should return issuing country', () => {
expect(documentResourceResponse.getIssuingCountry()).toBe('some-country');
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ describe('ZoomLivenessResourceResponse', () => {
});
});

describe('#getType', () => {
it('should return type', () => {
describe('#getLivenessType', () => {
it('should return liveness type', () => {
expect(zoomLivenessResourceResponse.getLivenessType()).toBe('some-liveness-type');
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const SupportedDocumentsResponse = require('../../../../src/doc_scan_service/support/supported.documents.response');
const SupportedDocumentsResponse = require('../../../src/doc_scan_service/support/supported.documents.response');

const SOME_DOCUMENT_TYPE = 'some-document-type';
const SOME_OTHER_DOCUMENT_TYPE = 'some-other-document-type';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,12 @@ describe('ThirdPartyAttributeExtensionBuilder', () => {
expect(thirdPartyAttributeExtension.content.getDefinitions()[1].getName()).toEqual('some_other_definition');
});

it('should should convert to JSON correctly', () => {
const date = new Date();
test.each([
['2020-01-02T00:00:00.123456Z', '2020-01-02T00:00:00.123Z'],
['2020-01-02T00:00:00.123+04:00', '2020-01-01T20:00:00.123Z'],
['2020-01-02T00:00:00.123-04:00', '2020-01-02T04:00:00.123Z'],
])('should should convert to JSON correctly', (inputDate, outputDate) => {
const date = new Date(inputDate);
const builder = new ThirdPartyAttributeExtensionBuilder()
.withExpiryDate(date)
.withDefinitions([
Expand All @@ -100,7 +104,7 @@ describe('ThirdPartyAttributeExtensionBuilder', () => {
const expectedJson = {
type: 'THIRD_PARTY_ATTRIBUTE',
content: {
expiry_date: date.toISOString(),
expiry_date: outputDate,
definitions: [
{ name: 'some_definition' },
{ name: 'some_other_definition' },
Expand Down

0 comments on commit 4e15b13

Please sign in to comment.