From 574e2df249f459c030a72af2fe4ff92908e9b0ec Mon Sep 17 00:00:00 2001 From: vbhayden <vbhayden3@gmail.com> Date: Thu, 5 Apr 2018 16:33:58 -0400 Subject: [PATCH] per issue https://github.com/adlnet/xAPI-Spec/issues/1073 --- test/v1_0_2/configs/statements.js | 31 ++++++++++++++++++++++++++++--- test/v1_0_3/configs/timestamps.js | 19 ++++++++++++++++++- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/test/v1_0_2/configs/statements.js b/test/v1_0_2/configs/statements.js index 66e332a..3086493 100644 --- a/test/v1_0_2/configs/statements.js +++ b/test/v1_0_2/configs/statements.js @@ -20,6 +20,7 @@ var VALID_EXTENSION = {extensions: {'http://example.com/null': null}}; var VALID_VERSION_1_0 = '1.0'; var VALID_VERSION_1_0_9 = '1.0.9'; + var INVALID_DATE_OFFSET = "2008-09-15T15:53:00-00"; // configures tests module.exports.config = function () { @@ -133,7 +134,15 @@ {timestamp: INVALID_DATE} ], expect: [400] - } + }, + { + name: 'statement "template" invalid date', + templates: [ + {statement: '{{statements.default}}'}, + {timestamp: INVALID_DATE_OFFSET} + ], + expect: [400] + }, ] }, { @@ -154,7 +163,15 @@ {timestamp: INVALID_DATE} ], expect: [400] - } + }, + { + name: 'statement "template" invalid date', + templates: [ + {statement: '{{statements.default}}'}, + {timestamp: INVALID_DATE_OFFSET} + ], + expect: [400] + }, ] }, { @@ -183,7 +200,15 @@ {stored: '2013-05-18T05:32:34.804Z'} ], expect: [400] - } + }, + { + name: 'statement "template" invalid date', + templates: [ + {statement: '{{statements.default}}'}, + {timestamp: INVALID_DATE_OFFSET} + ], + expect: [400] + }, ] }, { diff --git a/test/v1_0_3/configs/timestamps.js b/test/v1_0_3/configs/timestamps.js index 65b104b..4a817b9 100644 --- a/test/v1_0_3/configs/timestamps.js +++ b/test/v1_0_3/configs/timestamps.js @@ -11,6 +11,7 @@ // defines overwriting data var INVALID_DATE = '01/011/2015'; var INVALID_STRING = 'should fail'; + var INVALID_DATE_OFFSET = "2008-09-15T15:53:00-00"; // configures tests module.exports.config = function () { @@ -37,6 +38,14 @@ ], expect: [400] }, + { + name: 'statement "template" invalid date', + templates: [ + {statement: '{{statements.default}}'}, + {timestamp: INVALID_DATE_OFFSET} + ], + expect: [400] + }, { name: 'substatement "template" invalid string in timestamp', templates: [ @@ -52,7 +61,15 @@ {timestamp: INVALID_DATE} ], expect: [400] - } + }, + { + name: 'substatement "template" invalid date in timestamp', + templates: [ + {statement: '{{statements.default}}'}, + {timestamp: INVALID_DATE_OFFSET} + ], + expect: [400] + }, ] } ];