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.
66 lines • 2.18 kB
JavaScript
import React from "react";
import { TabNav } from ".";
import createSnapshot from "../../test/create-snapshot";
describe("<TabNav /> snapshot tests", function () {
it("renders correctly with default props", function () {
var snapshot = createSnapshot(React.createElement(TabNav, null, "Children"));
expect(snapshot).toMatchSnapshot();
});
it("renders correctly with default props and back button", function () {
var backButton = {
text: "text",
href: "href",
clickHandler: function clickHandler() {}
};
var snapshot = createSnapshot(React.createElement(TabNav, {
backButton: backButton
}, "Children"));
expect(snapshot).toMatchSnapshot();
});
it("renders correctly with textAlign = left and back button", function () {
var backButton = {
text: "text",
href: "href",
clickHandler: function clickHandler() {}
};
var snapshot = createSnapshot(React.createElement(TabNav, {
backButton: backButton,
textAlign: "left"
}, "Children"));
expect(snapshot).toMatchSnapshot();
});
it("renders correctly with variant = 'dark'", function () {
var snapshot = createSnapshot(React.createElement(TabNav, {
variant: "dark"
}, "Children"));
expect(snapshot).toMatchSnapshot();
});
it("renders correctly with back button and variant = 'dark'", function () {
var backButton = {
text: "text",
href: "href",
clickHandler: function clickHandler() {}
};
var snapshot = createSnapshot(React.createElement(TabNav, {
backButton: backButton,
variant: "dark"
}, "Children"));
expect(snapshot).toMatchSnapshot();
});
it("renders correctly with textAlign = 'left'", function () {
var snapshot = createSnapshot(React.createElement(TabNav, {
textAlign: "left"
}, "Children"));
expect(snapshot).toMatchSnapshot();
});
it("renders correctly with theme", function () {
var theme = {
nav: {
fontSize: "14px",
margin: "0"
}
};
var snapshot = createSnapshot(React.createElement(TabNav, null, "Children"), theme);
expect(snapshot).toMatchSnapshot();
});
});