vcc-ui
Version:
VCC UI is a collection of React UI Components that can be used for developing front-end applications at Volvo Car Corporation.
47 lines (39 loc) • 1.81 kB
JavaScript
;
var _react = _interopRequireDefault(require("react"));
var _ = require(".");
var _breakpoints = require("../../constants/breakpoints");
var _createSnapshot = _interopRequireDefault(require("../../test/create-snapshot"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
describe("<Button /> snapshot tests", function () {
var helloLabel = "Hello World";
it("renders <Button /> correctly with default props", function () {
var snapshot = (0, _createSnapshot.default)(_react.default.createElement(_.Button, null, helloLabel));
expect(snapshot).toMatchSnapshot();
});
it("renders <Button /> correctly with theme", function () {
var theme = {
button: {
background: "magenta"
}
};
var snapshot = (0, _createSnapshot.default)(_react.default.createElement(_.Button, null, helloLabel), theme);
expect(snapshot).toMatchSnapshot();
});
it("renders <Button /> correctly with theme and media queries", function () {
var _button;
var theme = {
button: {
button: (_button = {}, _defineProperty(_button, _breakpoints.BREAKPOINTS.onS, {
background: "blue"
}), _defineProperty(_button, _breakpoints.BREAKPOINTS.onM, {
background: "orange"
}), _defineProperty(_button, _breakpoints.BREAKPOINTS.onL, {
background: "magenta"
}), _button)
}
};
var snapshot = (0, _createSnapshot.default)(_react.default.createElement(_.Button, null, helloLabel), theme);
expect(snapshot).toMatchSnapshot();
});
});