Pārlūkot izejas kodu

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

Johan Ahlen 7 gadi atpakaļ
vecāks
revīzija
d40c4ffbfa

+ 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');