From 57af6b0ae074cbd020da80d4e37877739f6c5787 Mon Sep 17 00:00:00 2001 From: Andrew Michael McNutt Date: Thu, 15 Feb 2024 20:19:15 -0800 Subject: [PATCH] fix tests --- src/lib/ColorLint.test.ts | 2 +- src/lib/__snapshots__/ColorLint.test.ts.snap | 4 ++-- src/stores/example-store.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/ColorLint.test.ts b/src/lib/ColorLint.test.ts index 703d31f2..fa8a82ec 100644 --- a/src/lib/ColorLint.test.ts +++ b/src/lib/ColorLint.test.ts @@ -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(); }); diff --git a/src/lib/__snapshots__/ColorLint.test.ts.snap b/src/lib/__snapshots__/ColorLint.test.ts.snap index dfb3e08a..ac8d412e 100644 --- a/src/lib/__snapshots__/ColorLint.test.ts.snap +++ b/src/lib/__snapshots__/ColorLint.test.ts.snap @@ -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."`; diff --git a/src/stores/example-store.ts b/src/stores/example-store.ts index ed51db3d..17c13be5 100644 --- a/src/stores/example-store.ts +++ b/src/stores/example-store.ts @@ -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], };