Skip to content
Merged
Prev Previous commit
Next Next commit
Make plugin-api test clearer
  • Loading branch information
philipp-spiess committed Sep 17, 2024
commit bdf18bafd0c7261732fe3200f736ac1158b09c99
16 changes: 8 additions & 8 deletions packages/tailwindcss/src/compat/plugin-api.test.ts
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were actually unordered before. If no custom order is provided, we now follow back to ordering the argument if everything else is the same, This will make baked appear before yellow now.

Original file line number Diff line number Diff line change
Expand Up @@ -1541,10 +1541,10 @@ describe('matchVariant', () => {
return ({ matchVariant }: PluginAPI) => {
matchVariant('alphabet', (side) => `&${side}`, {
values: {
a: '[data-value="a"]',
b: '[data-value="b"]',
c: '[data-value="c"]',
d: '[data-value="d"]',
d: '[data-order="1"]',
a: '[data-order="2"]',
c: '[data-order="3"]',
b: '[data-order="4"]',
},
})
}
Expand All @@ -1560,19 +1560,19 @@ describe('matchVariant', () => {

expect(optimizeCss(compiled).trim()).toMatchInlineSnapshot(`
"@layer utilities {
.alphabet-a\\:underline[data-value="a"] {
.alphabet-d\\:underline[data-order="1"] {
text-decoration-line: underline;
}

.alphabet-b\\:underline[data-value="b"] {
.alphabet-a\\:underline[data-order="2"] {
text-decoration-line: underline;
}

.alphabet-c\\:underline[data-value="c"] {
.alphabet-c\\:underline[data-order="3"] {
text-decoration-line: underline;
}

.alphabet-d\\:underline[data-value="d"] {
.alphabet-b\\:underline[data-order="4"] {
text-decoration-line: underline;
}
}"
Expand Down