summaryrefslogtreecommitdiffstats
path: root/devtools/client/responsive/test/xpcshell/test_update_touch_simulation_enabled.js
blob: 5bed8dcab53bcf2e96e948599482c30e2ad30d3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

// Test updating the touch simulation `enabled` property

const {
  toggleTouchSimulation,
} = require("devtools/client/responsive/actions/ui");

add_task(async function() {
  const store = Store();
  const { getState, dispatch } = store;

  ok(
    !getState().ui.touchSimulationEnabled,
    "Touch simulation is disabled by default."
  );

  dispatch(toggleTouchSimulation(true));

  ok(getState().ui.touchSimulationEnabled, "Touch simulation is enabled.");
});