ReviewOS

also looking at this

stacks/ts-css

chore(deps): update actions/cache action to v6

#29
Open renovate[bot] wants to merge renovate/actions-cache-6.x into main
9 files +68 -9
packages/toolkit/test/engine/code-strings.test.tsmodified+31-0
Changes to packages/toolkit/test/engine/code-strings.test.ts
@@ -246,3 +246,34 @@ describe('code-string extraction past comments and regexes', () => {
246246 expect(classes.has('gap-3')).toBe(true)
247247 })
248248})
249
250describe('icons named by a component prop', () => {
251 it('takes an icon class out of any attribute, not only class', () => {
252 const classes = extractClasses(`<MoreMenu icon="i-hugeicons-settings-02"><EmptyState icon="i-hugeicons-note-01" text="Nothing"/></MoreMenu>`)
253
254 expect(classes.has('i-hugeicons-settings-02')).toBe(true)
255 expect(classes.has('i-hugeicons-note-01')).toBe(true)
256 })
257
258 it('takes one quoted inside a binding', () => {
259 const classes = extractClasses(`<Row :icon="done ? 'i-hugeicons-tick-02' : 'i-hugeicons-circle'" />`)
260
261 expect(classes.has('i-hugeicons-tick-02')).toBe(true)
262 expect(classes.has('i-hugeicons-circle')).toBe(true)
263 })
264
265 it('still ignores every other attribute value', () => {
266 const classes = extractClasses(`<a href="/p/ab-cd-ef" data-token="abc-123-xyz" title="bg-red-500 shadow-lg">x</a>`)
267
268 expect(classes.has('ab-cd-ef')).toBe(false)
269 expect(classes.has('abc-123-xyz')).toBe(false)
270 expect(classes.has('bg-red-500')).toBe(false)
271 })
272
273 it('does not take a word that merely contains i-', () => {
274 const classes = extractClasses(`<a title="semi-colon wi-fi pi-day">x</a>`)
275
276 expect(classes.has('i-colon')).toBe(false)
277 expect(classes.has('fi')).toBe(false)
278 })
279})