瀏覽代碼

HUE-8450 [editor] Add jasmine test for URL changes in embedded mode

Johan Ahlen 7 年之前
父節點
當前提交
d40c4ffbfa
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      desktop/core/src/desktop/static/desktop/spec/hueUtilsSpec.js

+ 9 - 0
desktop/core/src/desktop/static/desktop/spec/hueUtilsSpec.js

@@ -53,6 +53,15 @@
       hueUtils.changeURL('/jasmine');
     });
 
+    it("should change URL and a parameter in embedded mode", function () {
+      window.IS_EMBEDDED = true;
+      hueUtils.changeURL('/banana?peeled=no');
+      hueUtils.changeURLParameter('peeled', 'yes');
+      expect(/#\!\/banana\?peeled=yes/.test(window.location.href)).toBeTruthy();
+      window.IS_EMBEDDED = false;
+      window.location.hash = '';
+    });
+
     it("should remove a parameter in the URL", function () {
       hueUtils.changeURL('/banana?peeled=no');
       hueUtils.removeURLParameter('peeled');