2021-04-17 11:33:27 +00:00
|
|
|
import {
|
|
|
|
createRandomColorPalette,
|
|
|
|
RANDOM_PALETTE_ALGORITHMS,
|
|
|
|
} from "./random-colors";
|
2021-03-31 00:59:45 +00:00
|
|
|
|
2021-04-17 11:33:27 +00:00
|
|
|
describe("createRandomColorPalette()", () => {
|
|
|
|
for (let alg of RANDOM_PALETTE_ALGORITHMS) {
|
|
|
|
it(`works using the '${alg}' algorithm`, () => {
|
|
|
|
const palette = createRandomColorPalette(3, undefined, alg);
|
|
|
|
expect(palette).toHaveLength(3);
|
|
|
|
for (let color of palette) {
|
|
|
|
expect(color).toMatch(/^\#[0-9a-f]{6}$/);
|
|
|
|
}
|
|
|
|
});
|
2021-03-31 00:59:45 +00:00
|
|
|
}
|
|
|
|
});
|