"use strict";

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

var _enzyme = require("enzyme");

var _index = require("../index.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.
*/
describe('Component styled components', function () {
  test('StyledBody - basic render', function () {
    var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledBody, null));
    expect(component.instance().getStyles()).toMatchSnapshot('StyledBody has correct default styles');
    component.setProps({
      $kind: _index.KIND.info
    });
    expect(component.instance().getStyles().backgroundColor).toEqual('$theme.colors.toastPrimaryBackground');
    component.setProps({
      $kind: _index.KIND.positive
    });
    expect(component.instance().getStyles().backgroundColor).toEqual('$theme.colors.toastPositiveBackground');
    component.setProps({
      $kind: _index.KIND.warning
    });
    expect(component.instance().getStyles().backgroundColor).toEqual('$theme.colors.toastWarningBackground');
    component.setProps({
      $kind: _index.KIND.negative
    });
    expect(component.instance().getStyles().backgroundColor).toEqual('$theme.colors.toastNegativeBackground');
    component.setProps({
      $isVisible: false
    });
    expect(component.instance().getStyles().opacity).toEqual(0);
    component.setProps({
      $isVisible: true
    });
    expect(component.instance().getStyles().opacity).toEqual(1);
  });
  test('StyledBody - inline type styles', function () {
    var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledBody, {
      notificationType: _index.TYPE.inline
    }));
    expect(component.instance().getStyles()).toMatchSnapshot('StyledBody has correct default styles when type is set to TYPE.inline');
  });
  test('StyledCloseIcon - basic render', function () {
    var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledCloseIcon, {
      $prop: false
    }));
    expect(component.instance().getStyles()).toMatchSnapshot('StyledSvg has correct default styles');
  });
});