tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_ui_reducer.js (583B)


      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  updateSelectedPage,
      8 } = require("resource://devtools/client/application/src/actions/ui.js");
      9 
     10 const {
     11  uiReducer,
     12  UiState,
     13 } = require("resource://devtools/client/application/src/reducers/ui-state.js");
     14 
     15 add_task(async function () {
     16  info("Test ui reducer: UPDATE_SELECTED_PAGE action");
     17  const state = UiState();
     18  const action = updateSelectedPage("foo");
     19 
     20  const newState = uiReducer(state, action);
     21  equal(newState.selectedPage, "foo");
     22 });