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.
36 lines • 1.06 kB
JavaScript
import React from "react";
import { Slider } from ".";
import createSnapshot from "../../test/create-snapshot";
describe("<Slider /> snapshot tests", function () {
it("renders with numerical range", function () {
var snapshot = createSnapshot(React.createElement(Slider, {
initialValue: 3,
step: 1,
minValue: 1,
maxValue: 5
}));
expect(snapshot).toMatchSnapshot();
});
it("renders with valueList", function () {
var snapshot = createSnapshot(React.createElement(Slider, {
initialValue: 1,
valueList: [0, 1, 2, 3, 5, 8, 13, 21, 34, 66, 89, 144]
}));
expect(snapshot).toMatchSnapshot();
});
it("renders <Slider /> correctly with theme", function () {
var theme = {
slider: {
background: "orange"
},
sliderTrack: {
border: "25px"
}
};
var snapshot = createSnapshot(React.createElement(Slider, {
initialValue: 1,
valueList: [0, 1, 2, 3, 5, 8, 13, 21, 34, 66, 89, 144]
}), theme);
expect(snapshot).toMatchSnapshot();
});
});