excalidraw/src/tests/utils.test.ts
Aakansha Doshi ca60244aa3
hide fill icons when fill color transparent (#2414)
Co-authored-by: Panayiotis Lipiridis <lipiridis@gmail.com>
2020-11-26 21:43:38 +01:00

14 lines
460 B
TypeScript

import * as utils from "../utils";
describe("Test isTransparent", () => {
it("should return true when color is rgb transparent", () => {
expect(utils.isTransparent("#ff00")).toEqual(true);
expect(utils.isTransparent("#fff00000")).toEqual(true);
expect(utils.isTransparent("transparent")).toEqual(true);
});
it("should return false when color is not transparent", () => {
expect(utils.isTransparent("#ced4da")).toEqual(false);
});
});