浏览代码

tests for the feature

Raanan Weber 7 年之前
父节点
当前提交
6e831053e0
共有 1 个文件被更改,包括 31 次插入0 次删除
  1. 31 0
      Viewer/tests/unit/src/configuration/updateConfiguration.ts

+ 31 - 0
Viewer/tests/unit/src/configuration/updateConfiguration.ts

@@ -312,3 +312,34 @@ describe(name + " scene optimizer", () => {
         });
     });
 });
+
+describe(name + " camera", () => {
+
+    it("should enable and disable camera behaviors", (done) => {
+        let viewer = Helper.getNewViewerInstance(undefined, { extends: "none" });
+
+        viewer.onInitDoneObservable.add(() => {
+            assert.isFalse(viewer.sceneManager.camera.useAutoRotationBehavior);
+            viewer.updateConfiguration({
+                camera: {
+                    behaviors: {
+                        autoRotate: {
+                            type: 0
+                        }
+                    }
+                }
+            });
+            assert.isTrue(viewer.sceneManager.camera.useAutoRotationBehavior);
+            viewer.updateConfiguration({
+                camera: {
+                    behaviors: {
+                        autoRotate: false
+                    }
+                }
+            });
+            assert.isFalse(viewer.sceneManager.camera.useAutoRotationBehavior);
+            viewer.dispose();
+            done();
+        });
+    })
+})