15 lines
813 B
JavaScript
15 lines
813 B
JavaScript
const assert = require('assert')
|
|
const fs = require('fs')
|
|
const path = require('path')
|
|
|
|
const wxml = fs.readFileSync(path.join(__dirname, 'index.wxml'), 'utf8')
|
|
const wxss = fs.readFileSync(path.join(__dirname, 'index.wxss'), 'utf8')
|
|
const pageScript = fs.readFileSync(path.join(__dirname, 'index.js'), 'utf8')
|
|
|
|
assert.match(wxml, /class="modal-mask" bindtap="closeProductModal" catchtouchmove="stopTouchMove"/)
|
|
assert.match(wxml, /<scroll-view class="product-modal-scroll" scroll-y/)
|
|
assert.match(wxml, /<view class="product-list">/)
|
|
assert.match(wxss, /\.product-modal\s*\{[^}]*height:\s*88vh;[^}]*flex-direction:\s*column;[^}]*overflow:\s*hidden;/s)
|
|
assert.match(wxss, /\.product-modal-scroll\s*\{[^}]*flex:\s*1;[^}]*height:\s*0;[^}]*min-height:\s*0;/s)
|
|
assert.match(pageScript, /stopTouchMove\(\)\s*\{\s*\}/)
|