Skip to content

Commit e667d29

Browse files
committed
add explicit test for migrating main.foo to &main
1 parent c72b4be commit e667d29

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

packages/@tailwindcss-upgrade/src/codemods/migrate-at-layer-utilities.test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,25 @@ it('should migrate classes with element selectors', async () => {
290290
`)
291291
})
292292

293+
it('should migrate classes attached to an element selector', async () => {
294+
expect(
295+
await migrate(css`
296+
@layer utilities {
297+
main.no-scrollbar {
298+
display: none;
299+
}
300+
}
301+
`),
302+
).toMatchInlineSnapshot(`
303+
"@utility no-scrollbar {
304+
&main {
305+
display: none;
306+
}
307+
}
308+
"
309+
`)
310+
})
311+
293312
it('should migrate classes with id selectors', async () => {
294313
expect(
295314
await migrate(css`

0 commit comments

Comments
 (0)