@@ -97,6 +97,46 @@ describe("environment themes", () => {
9797 expect ( definitions . map ( ( definition ) => definition . id ) ) . toEqual ( [ "nightfall" ] ) ;
9898 } ) ;
9999
100+ it ( "drops published palettes with no usable colors" , ( ) => {
101+ const theme = { id : "invalid" , name : "Invalid" , appearance : "dark" } as const ;
102+ const definitions = publishedThemeDefinitions ( [
103+ { ...theme , colors : { canvas : "not-a-color" } } ,
104+ { ...theme , id : "unknown-roles" , colors : { futureRole : "#ffffff" } } ,
105+ {
106+ ...theme ,
107+ id : "ignored-variant" ,
108+ colors : { canvas : "not-a-color" } ,
109+ variants : { dark : { canvas : "#112233" } } ,
110+ } ,
111+ ] ) ;
112+
113+ expect ( definitions ) . toEqual ( [ ] ) ;
114+ } ) ;
115+
116+ it ( "keeps seeds, partial palettes, and usable alternate appearances" , ( ) => {
117+ const theme = { name : "Shared" , appearance : "dark" } as const ;
118+ const definitions = publishedThemeDefinitions ( [
119+ NIGHTFALL_THEME ,
120+ {
121+ ...theme ,
122+ id : "partial" ,
123+ colors : { canvas : "not-a-color" , text : "#ffffff" , futureRole : "#ffffff" } ,
124+ } ,
125+ {
126+ ...theme ,
127+ id : "light-variant" ,
128+ colors : { canvas : "not-a-color" } ,
129+ variants : { light : { canvas : "#eff1f5" } } ,
130+ } ,
131+ ] ) ;
132+
133+ expect ( definitions . map ( ( definition ) => definition . id ) ) . toEqual ( [
134+ "nightfall" ,
135+ "partial" ,
136+ "light-variant" ,
137+ ] ) ;
138+ } ) ;
139+
100140 // A machine may publish roles a newer client added; an older one has to
101141 // ignore them rather than render a broken palette.
102142 it ( "ignores published roles this build does not render" , ( ) => {
0 commit comments