function triggerPointerDownMoveUpTapSequence(moveDirection, diff) {
    if (window.getComputedStyle(toggle)['pointer-events'] === 'none')
      return;

    // Simulate events in the same order they are fired by the browser.
    // Need to provide a valid |pointerId| for setPointerCapture() to not throw
    // an error.
    const xStart = 100;
    toggle.dispatchEvent(
        new PointerEvent('pointerdown', {pointerId: 1, clientX: xStart}));
    let xEnd = xStart;
    if (moveDirection) {
      xEnd = moveDirection > 0 ? xStart + diff : xStart - diff;
      toggle.dispatchEvent(
          new PointerEvent('pointermove', {pointerId: 1, clientX: xEnd}));
    }
    toggle.dispatchEvent(
        new PointerEvent('pointerup', {pointerId: 1, clientX: xEnd}));
    MockInteractions.tap(toggle);
  }
/**
   * Simulates dragging the toggle button left/right.
   * @param {number} moveDirection -1 for left, 1 for right, 0 when no
   *     pointermove event should be simulated.
   * @param {number=} diff The move amount in pixels. Only relevant if
   *     moveDirection is non-zero.
   */
Simulates dragging the toggle button left/right.
@param {number} moveDirection -1 for left, 1 for right, 0 when no
pointermove event should be simulated.
@param {number=} diff The move amount in pixels. Only relevant if
moveDirection is non-zero.
Simulates dragging the toggle button left / right . @param { number } moveDirection - 1 for left 1 for right 0 when no pointermove event should be simulated . @param { number = } diff The move amount in pixels . Only relevant if moveDirection is non - zero .
function triggerPointerDownMoveUpTapSequence(moveDirection, diff) {
    if (window.getComputedStyle(toggle)['pointer-events'] === 'none')
      return;
    const xStart = 100;
    toggle.dispatchEvent(
        new PointerEvent('pointerdown', {pointerId: 1, clientX: xStart}));
    let xEnd = xStart;
    if (moveDirection) {
      xEnd = moveDirection > 0 ? xStart + diff : xStart - diff;
      toggle.dispatchEvent(
          new PointerEvent('pointermove', {pointerId: 1, clientX: xEnd}));
    }
    toggle.dispatchEvent(
        new PointerEvent('pointerup', {pointerId: 1, clientX: xEnd}));
    MockInteractions.tap(toggle);
  }
function triggerPointerDownMoveUpTapSequence ( moveDirection , diff ) { if ( window . getComputedStyle ( toggle ) [ 'pointer-events' ] === 'none' ) return ; const xStart = 100 ; toggle . dispatchEvent ( new PointerEvent ( 'pointerdown' , { pointerId : 1 , clientX : xStart } ) ) ; let xEnd = xStart ; if ( moveDirection ) { xEnd = moveDirection > 0 ? xStart + diff : xStart - diff ; toggle . dispatchEvent ( new PointerEvent ( 'pointermove' , { pointerId : 1 , clientX : xEnd } ) ) ; } toggle . dispatchEvent ( new PointerEvent ( 'pointerup' , { pointerId : 1 , clientX : xEnd } ) ) ; MockInteractions . tap ( toggle ) ; }
Simulates dragging the toggle button left/right.
Simulates dragging the toggle button left / right .
// Simulate events in the same order they are fired by the browser. // Need to provide a valid |pointerId| for setPointerCapture() to not throw // an error.