UNPKG

@netdata/charts

Version:

Netdata frontend SDK and chart utilities

32 lines (31 loc) 1.53 kB
"use strict"; var _dimensionColors = _interopRequireDefault(require("./dimensionColors")); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } 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); } describe("dimensionColors", function () { it("exports an array of color pairs", function () { expect(Array.isArray(_dimensionColors["default"])).toBe(true); expect(_dimensionColors["default"].length).toBeGreaterThan(0); }); it("contains color pair arrays", function () { _dimensionColors["default"].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["default"].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["default"].length).toBe(20); }); it("first color pair is correct", function () { expect(_dimensionColors["default"][0]).toEqual(["#3366CC", "#66AA00"]); }); });