Sfoglia il codice sorgente

tests for the feature

Raanan Weber 7 anni fa
parent
commit
6e831053e0
1 ha cambiato i file con 31 aggiunte e 0 eliminazioni
  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();
+        });
+    })
+})