diff --git a/pages/component/button/button.test.js b/pages/component/button/button.test.js index 3a3c201159fa41f52b3402da52b60d6e823666a4..98ccf957d9d9707eef72756d64a9746d3bd22cc8 100644 --- a/pages/component/button/button.test.js +++ b/pages/component/button/button.test.js @@ -35,9 +35,8 @@ describe('Button.uvue', () => { expect(await textBtn.text()).toEqual('button') }) it('type', async () => { - // TODO 目前获取组件属性只能通过组件的name,并且拿到的是最后一个 - const btn = await page.$('Button') - expect(await btn.property('type')).toBe('warn') + const btn = await page.$('.test-button') + expect(await btn.property('type')).toBe('primary') await page.setData({ type: 'default' }) @@ -50,19 +49,16 @@ describe('Button.uvue', () => { expect(await btn.property('type')).toBe('warn') }) it('size', async () => { - const btn = await page.$('Button') - expect(await btn.property('size')).toBe('mini') - await page.setData({ - size: 'default' - }) - await page.waitFor(500) + const btn = await page.$('.test-button') expect(await btn.property('size')).toBe('default') await page.setData({ size: 'mini' }) + await page.waitFor(500) + expect(await btn.property('size')).toBe('mini') }) it('plain', async () => { - const btn = await page.$('Button') + const btn = await page.$('.test-button') expect(await btn.property('plain')).toBe(false) await page.setData({ plain: true @@ -71,7 +67,7 @@ describe('Button.uvue', () => { expect(await btn.property('plain')).toBe(true) }) it('disabled', async () => { - const btn = await page.$('Button') + const btn = await page.$('.test-button') expect(await btn.property('disabled')).toBe(false) await page.setData({ disabled: true diff --git a/pages/component/button/button.uvue b/pages/component/button/button.uvue index 31a3c1cd59ad5c472fadb7fac2c1757944b0f849..928ece9d1ae583075f7bcd054da268626d799800 100644 --- a/pages/component/button/button.uvue +++ b/pages/component/button/button.uvue @@ -2,7 +2,8 @@ - + @@ -24,8 +25,7 @@ - + @@ -39,8 +39,8 @@ loading: false, _timer: 0, text: '按钮', - type: 'warn', - size: 'mini', + type: 'primary', + size: 'default', plain: false, disabled: false, count: 0