修复(斗鱼领取): 提交按钮适配苹果浏览器滚动与安全区
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import { readFile } from 'node:fs/promises'
|
||||
import test from 'node:test'
|
||||
|
||||
function source(relativePath: string) {
|
||||
return new URL(`../src/${relativePath}`, import.meta.url)
|
||||
}
|
||||
|
||||
test('斗鱼客户页复用客户移动端根类,避免 iOS Safari 动态视口裁切', async () => {
|
||||
const [app, css] = await Promise.all([
|
||||
readFile(source('App.tsx'), 'utf8'),
|
||||
readFile(source('styles/customer/mobile.css'), 'utf8'),
|
||||
])
|
||||
|
||||
assert.match(
|
||||
app,
|
||||
/function DouyuFulfillmentApplication\(\)\s*\{[^}]*useCustomerMobileViewport\(\)/s,
|
||||
)
|
||||
assert.match(
|
||||
css,
|
||||
/html\.customer-mobile-html,\s*body\.customer-mobile-body\s*\{[^}]*scroll-padding-bottom:/s,
|
||||
)
|
||||
})
|
||||
|
||||
test('斗鱼资料提交按钮在手机端保持可见且页面可滚动', async () => {
|
||||
const [page, css] = await Promise.all([
|
||||
readFile(source('pages/douyu-fulfillment/DouyuFulfillmentPage.tsx'), 'utf8'),
|
||||
readFile(source('styles/customer/platform/douyu.css'), 'utf8'),
|
||||
])
|
||||
|
||||
assert.ok(page.includes('customer-douyu-submit-bar'))
|
||||
assert.match(
|
||||
css,
|
||||
/\.customer-auth-page\.is-douyu:not\(\.is-compact\)\s*\{[^}]*min-height:\s*100dvh;[^}]*overflow-y:\s*visible/s,
|
||||
)
|
||||
assert.match(
|
||||
css,
|
||||
/\.customer-auth-page\.is-douyu:not\(\.is-compact\) \.customer-douyu-submit-bar\s*\{[^}]*position:\s*sticky;[^}]*bottom:\s*0;[^}]*env\(safe-area-inset-bottom\)/s,
|
||||
)
|
||||
assert.match(
|
||||
css,
|
||||
/\.customer-auth-page\.is-douyu\.is-compact \.customer-binding-stage\s*\{[^}]*overflow-y:\s*auto/s,
|
||||
)
|
||||
})
|
||||
Reference in New Issue
Block a user