summaryrefslogtreecommitdiffstats
path: root/devtools/client/responsive.html/test/unit/test_change_location.js
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/client/responsive.html/test/unit/test_change_location.js')
-rw-r--r--devtools/client/responsive.html/test/unit/test_change_location.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/devtools/client/responsive.html/test/unit/test_change_location.js b/devtools/client/responsive.html/test/unit/test_change_location.js
new file mode 100644
index 000000000..d45ce5c7a
--- /dev/null
+++ b/devtools/client/responsive.html/test/unit/test_change_location.js
@@ -0,0 +1,22 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Test changing the location of the displayed page.
+
+const { changeLocation } =
+ require("devtools/client/responsive.html/actions/location");
+
+const TEST_URL = "http://example.com";
+
+add_task(function* () {
+ let store = Store();
+ const { getState, dispatch } = store;
+
+ equal(getState().location, "about:blank",
+ "Defaults to about:blank at startup");
+
+ dispatch(changeLocation(TEST_URL));
+ equal(getState().location, TEST_URL, "Location changed to TEST_URL");
+});