@@ -2,6 +2,7 @@ import { test, expect } from '@playwright/test'
22import { dirname , resolve } from 'path'
33import { fileURLToPath } from 'url'
44import init from './init'
5+ import { modeTrigger } from '~/examples/webpack/master.css'
56
67const __filename = fileURLToPath ( import . meta. url )
78const __dirname = dirname ( __filename )
@@ -31,8 +32,8 @@ const modes = {
3132}
3233
3334test . beforeEach ( async ( { page } ) => {
34- await init ( page )
35- await page . evaluate ( ( { variables, modes } ) => globalThis . cssRuntime . refresh ( { variables, modes } ) , { variables, modes } )
35+ await init ( page , '' , { modeTrigger : 'class' } )
36+ await page . evaluate ( ( { variables, modes } ) => globalThis . cssRuntime . refresh ( { variables, modes, modeTrigger : 'class' } ) , { variables, modes } )
3637} )
3738
3839test ( 'expects the variable output' , async ( { page } ) => {
@@ -46,7 +47,7 @@ test('expects the variable output', async ({ page }) => {
4647 return globalThis . cssRuntime . text
4748 } ) ,
4849 {
49- theme : ':root{--first:17 17 17}.dark {--first:34 34 34}.light {--first:51 51 51 }' ,
50+ theme : ':root{--first:17 17 17}.light {--first:51 51 51}.dark {--first:34 34 34 }' ,
5051 general : '.bg\\:first{background-color:rgb(var(--first))}'
5152 }
5253 )
@@ -77,7 +78,7 @@ test('expects the variable output', async ({ page }) => {
7778 // todo: insertRule throw error
7879 // expect(text).toContain('.\\{outline\\:fourth\\;accent\\:fifth\\}{outline-color:rgb(var(--fourth));accent-color:rgb(var(--fifth))}')
7980 expect ( text ) . toContain ( '.fg\\:second{color:rgb(var(--second))}' )
80- expect ( text ) . toMatch ( / \. d a r k \{ [ ^ } ] * - - s i x t h : 1 0 2 1 0 2 1 0 2 [ ^ } ] * \} / )
81+ expect ( text ) . toMatch ( / \. l i g h t , : r o o t \{ [ ^ } ] * - - s i x t h : 1 0 2 1 0 2 1 0 2 [ ^ } ] * \} / )
8182
8283 text = await page . evaluate ( async ( ) => {
8384 document . getElementById ( 'mp' ) ?. classList . remove ( 'bg:second' )
0 commit comments