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.
35 lines • 1.25 kB
JavaScript
import React from "react";
import { Nav } from ".";
import createSnapshot from "../../test/create-snapshot";
describe("<Nav /> snapshot tests", function () {
it("renders correctly with default props", function () {
var snapshot = createSnapshot(React.createElement(Nav, null, "Children"));
expect(snapshot).toMatchSnapshot();
});
it("renders correctly with hideOnScroll=true", function () {
var snapshot = createSnapshot(React.createElement(Nav, {
hideOnScroll: true
}, "Children"));
expect(snapshot).toMatchSnapshot();
});
it("renders correctly with sticky=true", function () {
var snapshot = createSnapshot(React.createElement(Nav, {
sticky: true
}, "Children"));
expect(snapshot).toMatchSnapshot();
});
it("renders correctly with sticky=true and hideOnScroll=true", function () {
var snapshot = createSnapshot(React.createElement(Nav, null, "Children"));
expect(snapshot).toMatchSnapshot();
});
it("renders correctly with theme", function () {
var theme = {
nav: {
fontSize: "14px",
margin: "0"
}
};
var snapshot = createSnapshot(React.createElement(Nav, null, "Test Theme"), theme);
expect(snapshot).toMatchSnapshot();
});
});