diff --git a/tests/js/common/aql/aql-view-arangosearch-ddl-cluster.js b/tests/js/common/aql/aql-view-arangosearch-ddl-cluster.js index f70f927fc4..d778016c4e 100644 --- a/tests/js/common/aql/aql-view-arangosearch-ddl-cluster.js +++ b/tests/js/common/aql/aql-view-arangosearch-ddl-cluster.js @@ -739,6 +739,29 @@ function IResearchFeatureDDLTestSuite () { }); }, + //////////////////////////////////////////////////////////////////////////// + /// @brief test create & drop of a view with a link. + /// Regression test for arangodb/backlog#486. + //////////////////////////////////////////////////////////////////////////// + testCreateAndDropViewWithLink: function () { + const colName = 'TestCollection'; + const viewName = 'TestView'; + + db._drop(colName); + db._dropView(viewName); + + const col = db._create(colName); + for (let i = 0; i < 10; i++) { + col.insert({ i }); + } + { + const view = db._createView(viewName, 'arangosearch', {}); + view.properties({ links: { [colName]: { includeAllFields: true } } }); + db._dropView(viewName); + } // forget variable `view`, it's invalid now + assertEqual(db[viewName], undefined); + }, + }; } diff --git a/tests/js/common/aql/aql-view-arangosearch-ddl-noncluster.js b/tests/js/common/aql/aql-view-arangosearch-ddl-noncluster.js index aa9dda2aa0..656e3b3d9a 100644 --- a/tests/js/common/aql/aql-view-arangosearch-ddl-noncluster.js +++ b/tests/js/common/aql/aql-view-arangosearch-ddl-noncluster.js @@ -639,6 +639,29 @@ function IResearchFeatureDDLTestSuite () { }); }, + //////////////////////////////////////////////////////////////////////////// + /// @brief test create & drop of a view with a link. + /// Regression test for arangodb/backlog#486. + //////////////////////////////////////////////////////////////////////////// + testCreateAndDropViewWithLink: function () { + const colName = 'TestCollection'; + const viewName = 'TestView'; + + db._drop(colName); + db._dropView(viewName); + + const col = db._create(colName); + for (let i = 0; i < 10; i++) { + col.insert({ i }); + } + { + const view = db._createView(viewName, 'arangosearch', {}); + view.properties({ links: { [colName]: { includeAllFields: true } } }); + db._dropView(viewName); + } // forget variable `view`, it's invalid now + assertEqual(db[viewName], undefined); + }, + }; }