Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mcnuttandrew committed Feb 16, 2024
1 parent f5560cc commit 57af6b0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib/ColorLint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ test("ColorLint - ColorNameDiscriminability", async () => {

test("ColorLint - SizeDiscrim (Thin)", () => {
const examplePal = makePalFromString(["#0084a9", "#bad", "#008000"]);
const newLint = CreateCustomLint(SizeDiscrims[0]);
const exampleLint = new newLint(examplePal).run();
expect(exampleLint.passes).toBe(true);
expect(exampleLint.message).toMatchSnapshot();

const examplePal2 = makePalFromString(["#0084a9", "#009de5", "#8ca9fa"]);
const exampleLint2 = new newLint(examplePal2).run();
const newLint = CreateCustomLint(SizeDiscrims[0]);
expect(exampleLint2.passes).toBe(false);
expect(exampleLint2.message).toMatchSnapshot();
});
Expand Down
4 changes: 2 additions & 2 deletions src/lib/__snapshots__/ColorLint.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ exports[`ColorLint - Fair Sequential 1`] = `"This palette is unfair (meaning tha

exports[`ColorLint - Fair Sequential 2`] = `"This palette is unfair (meaning that some values may unduely stand out). Note that this check is naturally at odds with color blind friendly palettes. Maximum chroma range: 50."`;

exports[`ColorLint - Gamut 1`] = `"The color is not in the sRGB gamut. Please choose a color that is in the sRGB gamut."`;
exports[`ColorLint - Gamut 1`] = `"A color or colors is not in the sRGB gamut (#0087a5). Please adjust the color so that it can be displayed on most devices."`;

exports[`ColorLint - Gamut 2`] = `"The color is not in the sRGB gamut. Please choose a color that is in the sRGB gamut."`;
exports[`ColorLint - Gamut 2`] = `"A color or colors is not in the sRGB gamut (). Please adjust the color so that it can be displayed on most devices."`;

exports[`ColorLint - MaxColors 1`] = `"This palette has too many colors and may be hard to discriminate in some contexts. Maximum: 10."`;

Expand Down
2 changes: 1 addition & 1 deletion src/stores/example-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function createStore() {
return acc;
}, {} as any);
if (x) {
const examples = x.examples.filter((x) => preBuiltMap[x.name]);
const examples = x.examples.filter((x: any) => preBuiltMap[x.name]);
const newStore = {
examples: [...prebuiltExamples, ...examples],
};
Expand Down

0 comments on commit 57af6b0

Please sign in to comment.