Files
wwjcloud-nest-v1/wwjcloud-nest-v1/uniappx/demo/pages/component-instance/attrs/attrs.test.js
wanwu 6eb9ea687d feat: 初始化项目代码
- 迁移 NestJS 项目结构
- 添加 uniappx 前端代码
- 配置数据库连接
- 添加核心业务模块
2026-04-02 21:25:02 +08:00

30 lines
987 B
JavaScript

const OPTIONS_PAGE_PATH = '/pages/component-instance/attrs/attrs-options'
const COMPOSITION_PAGE_PATH = '/pages/component-instance/attrs/attrs-composition'
describe('$attrs', () => {
const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
const isMP = platformInfo.startsWith('mp')
const test = async (pagePath) => {
const page = await program.reLaunch(pagePath)
await page.waitFor('view')
await page.waitFor(1000)
const hasPropsAttr = await page.$('#has-props-attr')
expect(await hasPropsAttr.text()).toBe('false')
const hasEmitsAttr = await page.$('#has-emits-attr')
expect(await hasEmitsAttr.text()).toBe('false')
if(!isMP) {
const hasClassAttr = await page.$('#has-class-attr')
expect(await hasClassAttr.text()).toBe('true')
}
}
it('$attrs options API', async () => {
await test(OPTIONS_PAGE_PATH)
})
it('useAttrs composition API', async () => {
await test(COMPOSITION_PAGE_PATH)
})
})