Files
pda-overseas-uniapp/tests/h5-button-reset.test.mjs
2026-08-28 10:03:42 +08:00

17 lines
557 B
JavaScript

import assert from 'node:assert/strict'
import { readFile } from 'node:fs/promises'
import test from 'node:test'
const stylesheet = await readFile(new URL('../src/styles/pda.scss', import.meta.url), 'utf8')
test('H5 removes the uni-app default button pseudo-element border', () => {
assert.match(
stylesheet,
/button::after,\s*uni-button::after\s*\{\s*border:\s*0\s*!important;/
)
})
test('keyboard focus remains visible after removing the default border', () => {
assert.match(stylesheet, /button:focus-visible[\s\S]*?outline:\s*3px\s+solid/)
})