diff --git a/js/common/tests/shell-document.js b/js/common/tests/shell-document.js index 6954184bea..68c6412f6e 100644 --- a/js/common/tests/shell-document.js +++ b/js/common/tests/shell-document.js @@ -215,6 +215,22 @@ function CollectionDocumentSuite () { wait(0.0); }, +//////////////////////////////////////////////////////////////////////////////// +/// @brief create a document w/ invalid primary key data types +//////////////////////////////////////////////////////////////////////////////// + + testSaveInvalidDocumentKeyType : function () { + [ 1, 2, 3, false, true, null, [ ], { } ].forEach(function (key) { + try { + collection.save({ _key: key }); + fail(); + } + catch (err) { + assertEqual(ERRORS.ERROR_ARANGO_DOCUMENT_KEY_BAD.code, err.errorNum); + } + }); + }, + //////////////////////////////////////////////////////////////////////////////// /// @brief create a document w/ primary key violation ////////////////////////////////////////////////////////////////////////////////