aboutsummaryrefslogtreecommitdiffstats
path: root/packages/excalidraw/tests/utils.test.ts
blob: 34944faaa016a34e9dd40604ee039c09fddf7d91 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import { isTransparent } from "../utils";

describe("Test isTransparent", () => {
  it("should return true when color is rgb transparent", () => {
    expect(isTransparent("#ff00")).toEqual(true);
    expect(isTransparent("#fff00000")).toEqual(true);
    expect(isTransparent("transparent")).toEqual(true);
  });

  it("should return false when color is not transparent", () => {
    expect(isTransparent("#ced4da")).toEqual(false);
  });
});