Skip to content

Commit

Permalink
Remove outdated tests and add new global extends test for improved fu…
Browse files Browse the repository at this point in the history
…nctionality
  • Loading branch information
1aron committed Dec 17, 2024
1 parent 33947e5 commit 18c4f0e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 42 deletions.
18 changes: 0 additions & 18 deletions packages/runtime/e2e/example.spec.ts

This file was deleted.

28 changes: 28 additions & 0 deletions packages/runtime/e2e/global-extends.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { test, expect } from '@playwright/test'
import { dirname, resolve } from 'path'
import { fileURLToPath } from 'url'

const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)

test('extends', async ({ page }) => {
await page.evaluate(() => {
globalThis.masterCSSConfigs = [{
variables: {
primary: '#000000'
}
}]
globalThis.masterCSSConfig = {
extends: [{
variables: {
secondary: '#ffffff'
}
}]
}
})
await page.addScriptTag({ path: resolve(__dirname, '../dist/global.min.js') })
expect(await page.evaluate(() => globalThis.masterCSSConfigs)).toBeDefined()
expect(await page.evaluate(() => globalThis.runtimeCSS.variables.primary)).toBeDefined()
expect(await page.evaluate(() => globalThis.runtimeCSS.variables.secondary)).toBeDefined()
expect(await page.evaluate(() => globalThis.runtimeCSS.customConfig.extends?.length)).toBe(2)
})
24 changes: 0 additions & 24 deletions packages/runtime/tests/global-extends.test.ts

This file was deleted.

0 comments on commit 18c4f0e

Please sign in to comment.