@enact/sandstone
Version:
Large-screen/TV support library for Enact, containing a variety of UI components.
57 lines (56 loc) • 2.07 kB
JavaScript
;
require("@testing-library/jest-dom");
var _react = require("@testing-library/react");
var _Heading = require("../Heading");
var _jsxRuntime = require("react/jsx-runtime");
describe('Heading Specs', function () {
test('should render a Heading with content', function () {
var content = 'Hello Heading!';
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Heading.HeadingBase, {
"data-testid": "heading",
children: content
}));
var heading = _react.screen.getByTestId('heading').textContent;
expect(heading).toBe(content);
});
test('should add the showLine class', function () {
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Heading.HeadingBase, {
"data-testid": "heading",
showLine: true,
children: "check"
}));
var heading = _react.screen.getByTestId('heading');
var expected = 'showLine';
expect(heading).toHaveClass(expected);
});
test('should have large class if `size` is large', function () {
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Heading.HeadingBase, {
"data-testid": "heading",
size: "large",
children: "Hello Heading"
}));
var heading = _react.screen.getByTestId('heading');
var expected = 'large';
expect(heading).toHaveClass(expected);
});
test('should have small class if `size` is small', function () {
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Heading.HeadingBase, {
"data-testid": "heading",
size: "small",
children: "Hello Heading"
}));
var heading = _react.screen.getByTestId('heading');
var expected = 'small';
expect(heading).toHaveClass(expected);
});
test('should have tiny class if `size` is tiny', function () {
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Heading.HeadingBase, {
"data-testid": "heading",
size: "tiny",
children: "Hello Heading"
}));
var heading = _react.screen.getByTestId('heading');
var expected = 'tiny';
expect(heading).toHaveClass(expected);
});
});