Skip to content

Commit b71ca4e

Browse files
test(e2e): expect v4 colors for compiled Tailwind class names
Refs #770, #734 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
1 parent 7960b48 commit b71ca4e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎e2e/tailwind-hover-order.spec.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ for (const singleCss of [true, false]) {
154154
for (const fixture of cases) {
155155
for (const [index, width] of [640, 1024].entries()) {
156156
const label = 'props' in fixture ? 'explicit Devup guard: ' : ''
157+
const devupColorIndex = 'props' in fixture ? 1 : 0
157158
test(`${label}${fixture.classes}, ${width}px, singleCss=${singleCss}`, async ({
158159
page,
159160
}, testInfo) => {
@@ -191,7 +192,7 @@ for (const singleCss of [true, false]) {
191192
const observed = []
192193
for (const [name, classes, css, color] of [
193194
['Tailwind', fixture.classes, oracleCss, expected[0]],
194-
['Devup', matched?.[1], devupCss, expected[1]],
195+
['Devup', matched?.[1], devupCss, expected[devupColorIndex]],
195196
]) {
196197
await page.setContent(
197198
`<!doctype html><html data-theme="dark"><head><style>${css}</style></head><body><button id="target" class="${classes}" ${disabled ? 'disabled' : ''} style="width:160px;height:80px">probe</button></body></html>`,
@@ -207,14 +208,14 @@ for (const singleCss of [true, false]) {
207208
} else if (!disabled) {
208209
await expect(target).toHaveCSS(
209210
'background-color',
210-
colors.red[name === 'Tailwind' ? 0 : 1],
211+
colors.red[name === 'Tailwind' ? 0 : devupColorIndex],
211212
)
212213
}
213214
if (fixture.classes.includes('focus:')) {
214215
await target.focus()
215216
await expect(target).toHaveCSS(
216217
'background-color',
217-
colors.green[name === 'Tailwind' ? 0 : 1],
218+
colors.green[name === 'Tailwind' ? 0 : devupColorIndex],
218219
)
219220
}
220221
await page.mouse.down()

0 commit comments

Comments
 (0)