@@ -59,6 +59,13 @@ function spread(color: RGBA) {
5959 return Math . max ( r , g , b ) - Math . min ( r , g , b )
6060}
6161
62+ function expectIndexed ( color : unknown ) {
63+ const rgba = expectRgba ( color )
64+ expect ( rgba . intent ) . toBe ( "indexed" )
65+ expect ( rgba . slot ) . toBeGreaterThanOrEqual ( 0 )
66+ expect ( rgba . slot ) . toBeLessThan ( 256 )
67+ }
68+
6269test ( "falls back when palette lookup fails" , async ( ) => {
6370 expect ( await resolveRunTheme ( renderer ( { fail : true } ) ) ) . toBe ( RUN_THEME_FALLBACK )
6471} )
@@ -71,10 +78,10 @@ test("returns syntax styles and indexed splash colors", async () => {
7178 expect ( theme . block . subtleSyntax ) . toBeDefined ( )
7279 expect ( [ ...theme . block . syntax ! . getAllStyles ( ) ] . length ) . toBeGreaterThan ( 0 )
7380 expect ( [ ...theme . block . subtleSyntax ! . getAllStyles ( ) ] . length ) . toBeGreaterThan ( 0 )
74- expect ( RGBA . getIntentTag ( expectRgba ( theme . splash . left ) ) ) . toBeLessThan ( 256 )
75- expect ( RGBA . getIntentTag ( expectRgba ( theme . splash . right ) ) ) . toBeLessThan ( 256 )
76- expect ( RGBA . getIntentTag ( expectRgba ( theme . splash . leftShadow ) ) ) . toBeLessThan ( 256 )
77- expect ( RGBA . getIntentTag ( expectRgba ( theme . splash . rightShadow ) ) ) . toBeLessThan ( 256 )
81+ expectIndexed ( theme . splash . left )
82+ expectIndexed ( theme . splash . right )
83+ expectIndexed ( theme . splash . leftShadow )
84+ expectIndexed ( theme . splash . rightShadow )
7885 expectRgba ( theme . footer . highlight )
7986 expectRgba ( theme . footer . surface )
8087 } finally {
0 commit comments