"use strict";

var _jsxRuntime = require("react/jsx-runtime");

var _enzyme = require("enzyme");

var _FloatingLayer = require("@enact/ui/FloatingLayer");

var _Tooltip = require("../Tooltip");

describe('TooltipDecorator Specs', function () {
  test('should render component into FloatingLayer if open', function () {
    var Root = (0, _FloatingLayer.FloatingLayerDecorator)('div');
    var tooltipText = 'This is a tooltip';
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(Root, {
      children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_FloatingLayer.FloatingLayerBase, {
        open: true,
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.Tooltip, {
          children: tooltipText
        })
      })
    }));
    var expected = tooltipText;
    var actual = subject.find('FloatingLayer').text();
    expect(actual).toBe(expected);
  });
  test('should not render component into FloatingLayer if not open', function () {
    var Root = (0, _FloatingLayer.FloatingLayerDecorator)('div');
    var tooltipText = 'This is a tooltip';
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(Root, {
      children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_FloatingLayer.FloatingLayerBase, {
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.Tooltip, {
          children: tooltipText
        })
      })
    }));
    var expected = '';
    var actual = subject.find('FloatingLayer').text();
    expect(actual).toBe(expected);
  });
});