test_page_reducer.js (605B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 const { 7 updateDomain, 8 } = require("resource://devtools/client/application/src/actions/page.js"); 9 10 const { 11 pageReducer, 12 PageState, 13 } = require("resource://devtools/client/application/src/reducers/page-state.js"); 14 15 add_task(async function () { 16 info("Test page reducer: UPDATE_DOMAIN action"); 17 const state = PageState(); 18 const action = updateDomain("https://example.com/foo/#bar"); 19 20 const newState = pageReducer(state, action); 21 equal(newState.domain, "example.com"); 22 });