"use strict";

var _react = _interopRequireDefault(require("react"));

var _enzyme = require("enzyme");

var _statefulPagination = _interopRequireDefault(require("../stateful-pagination.js"));

var _statefulContainer = _interopRequireDefault(require("../stateful-container.js"));

var _pagination = _interopRequireDefault(require("../pagination.js"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/*
Copyright (c) 2018 Uber Technologies, Inc.

This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
function getSharedProps() {
  return {
    numPages: 5,
    initialState: {
      currentPage: 2
    },
    extraProp: 'extra'
  };
}

describe('Pagination StatefulPagination', function () {
  test('renders with props', function () {
    var component = (0, _enzyme.mount)(_react.default.createElement(_statefulPagination.default, getSharedProps()));
    expect(component.find(_statefulContainer.default).length).toBe(1);
    expect(component.find(_statefulContainer.default).prop('initialState')).toEqual({
      currentPage: 2
    });
    expect(component.find(_pagination.default).length).toBe(1);
    expect(component.find(_pagination.default).prop('initialState')).not.toBeDefined();
    expect(component.find(_pagination.default).prop('extraProp')).toEqual('extra');
  });
});