@netdata/charts
Version:
Netdata frontend SDK and chart utilities
29 lines • 1.32 kB
JavaScript
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
import dimensionColors from "./dimensionColors";
describe("dimensionColors", function () {
it("exports an array of color pairs", function () {
expect(Array.isArray(dimensionColors)).toBe(true);
expect(dimensionColors.length).toBeGreaterThan(0);
});
it("contains color pair arrays", function () {
dimensionColors.forEach(function (colorPair) {
expect(Array.isArray(colorPair)).toBe(true);
expect(colorPair).toHaveLength(2);
});
});
it("contains valid hex color strings", function () {
var hexColorRegex = /^#[0-9A-F]{6}$/i;
dimensionColors.forEach(function (colorPair) {
colorPair.forEach(function (color) {
expect(_typeof(color)).toBe("string");
expect(color).toMatch(hexColorRegex);
});
});
});
it("has consistent color pairs count", function () {
expect(dimensionColors.length).toBe(20);
});
it("first color pair is correct", function () {
expect(dimensionColors[0]).toEqual(["#3366CC", "#66AA00"]);
});
});