@netdata/netdata-ui
Version:
netdata UI kit
67 lines • 2.02 kB
JavaScript
import { DefaultTheme as theme } from "../theme/default";
import styledRound from "./round";
it("renders", function () {
expect(styledRound({
theme: theme
})).toBe("");
});
it("renders default round", function () {
expect(styledRound({
theme: theme,
round: true
})).toBe("border-radius: " + theme.constants.SIZE_SUB_UNIT + "px;");
});
it("renders fixed round", function () {
expect(styledRound({
theme: theme,
round: 2
})).toBe("border-radius: " + theme.constants.SIZE_SUB_UNIT * 2 + "px;");
});
it("renders string", function () {
expect(styledRound({
theme: theme,
round: "10rem"
})).toBe("border-radius: 10rem;");
});
it("renders top round", function () {
expect(styledRound({
theme: theme,
round: {
side: "top",
size: 3
}
})).toBe("\n border-top-left-radius: " + theme.constants.SIZE_SUB_UNIT * 3 + "px;\n border-top-right-radius: " + theme.constants.SIZE_SUB_UNIT * 3 + "px;\n ");
});
it("renders left round", function () {
expect(styledRound({
theme: theme,
round: {
side: "left",
size: 3
}
})).toBe("\n border-top-left-radius: " + theme.constants.SIZE_SUB_UNIT * 3 + "px;\n border-bottom-left-radius: " + theme.constants.SIZE_SUB_UNIT * 3 + "px;\n ");
});
it("renders bottom round", function () {
expect(styledRound({
theme: theme,
round: {
side: "bottom",
size: 3
}
})).toBe("\n border-bottom-left-radius: " + theme.constants.SIZE_SUB_UNIT * 3 + "px;\n border-bottom-right-radius: " + theme.constants.SIZE_SUB_UNIT * 3 + "px;\n ");
});
it("renders right round", function () {
expect(styledRound({
theme: theme,
round: {
side: "right",
size: 3
}
})).toBe("\n border-top-right-radius: " + theme.constants.SIZE_SUB_UNIT * 3 + "px;\n border-bottom-right-radius: " + theme.constants.SIZE_SUB_UNIT * 3 + "px;\n ");
});
it("renders invalid", function () {
expect(styledRound({
theme: theme,
round: null
})).toBe("");
});