This repository was archived by the owner on Oct 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test(noticebar): add noticebar test * fix(Noticebar): marquee 属性 * chore: rename button test file Co-authored-by: pengshanglong <[email protected]>
- v1.0.0-beta.16
- v1.0.0-beta.13
- v1.0.0-beta.12
- v1.0.0-beta.11
- v1.0.0-beta.10
- v1.0.0-beta.9
- v1.0.0-beta.8
- v1.0.0-beta.7
- v1.0.0-beta.6
- v1.0.0-beta.5
- v1.0.0-beta.4
- v1.0.0-beta.3
- v1.0.0-beta.2
- v1.0.0-beta.1
- v1.0.0-alpha.15
- v1.0.0-alpha.14
- v1.0.0-alpha.13
- v1.0.0-alpha.12
- v1.0.0-alpha.11
- v1.0.0-alpha.10
- v1.0.0-alpha.9
- v1.0.0-alpha.8
- v1.0.0-alpha.7
- v1.0.0-alpha.6
- v1.0.0-alpha.5
- v1.0.0-alpha.4
- v1.0.0-alpha.3
- v1.0.0-alpha.2
- v1.0.0-alpha.1
- v1.0.0-alpha.0
- v0.0.10
Showing
7 changed files
with
209 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
- Noticebar marquee 属性 还不可用 | ||
- Button Invalid handler for event "getPhoneNumber": got undefined 等错误请查看[小程序button](https://developers.weixin.qq.com/miniprogram/dev/component/button.html) | ||
- Accordion 动画不顺滑 | ||
- Indexes 跳转动画有问题 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`AtNoticebar Snap render AtNoticebar -- props icon 1`] = ` | ||
<view | ||
class="at-noticebar" | ||
> | ||
<view | ||
class="at-noticebar__content" | ||
> | ||
<view | ||
class="at-noticebar__content-icon" | ||
> | ||
<view | ||
class="at-icon at-icon-volume-plus at-icon at-icon-volume-plus" | ||
/> | ||
</view> | ||
<view | ||
class="at-noticebar__content-text" | ||
> | ||
<view | ||
animation="[object Object]" | ||
class="at-noticebar__content-inner" | ||
> | ||
这是内容 | ||
</view> | ||
</view> | ||
</view> | ||
</view> | ||
`; | ||
|
||
exports[`AtNoticebar Snap render AtNoticebar -- props moreText & showMore 1`] = ` | ||
<view | ||
class="at-noticebar at-noticebar--single" | ||
> | ||
<view | ||
class="at-noticebar__content" | ||
> | ||
<view | ||
class="at-noticebar__content-text" | ||
> | ||
<view | ||
animation="[object Object]" | ||
class="at-noticebar__content-inner" | ||
> | ||
这是内容 | ||
</view> | ||
</view> | ||
</view> | ||
<view | ||
class="at-noticebar__more" | ||
> | ||
<view | ||
class="text" | ||
> | ||
查看更多 | ||
</view> | ||
<view | ||
class="at-noticebar__more-icon" | ||
> | ||
<view | ||
class="at-icon at-icon-chevron-right" | ||
/> | ||
</view> | ||
</view> | ||
</view> | ||
`; | ||
|
||
exports[`AtNoticebar Snap render AtNoticebar -- props show 1`] = ` | ||
<view | ||
class="at-noticebar" | ||
> | ||
<view | ||
class="at-noticebar__close" | ||
> | ||
<view | ||
class="at-icon at-icon-close" | ||
/> | ||
</view> | ||
<view | ||
class="at-noticebar__content" | ||
> | ||
<view | ||
class="at-noticebar__content-text" | ||
> | ||
<view | ||
animation="[object Object]" | ||
class="at-noticebar__content-inner" | ||
> | ||
这是内容 | ||
</view> | ||
</view> | ||
</view> | ||
</view> | ||
`; | ||
|
||
exports[`AtNoticebar Snap render AtNoticebar -- props single 1`] = ` | ||
<view | ||
class="at-noticebar at-noticebar--single" | ||
> | ||
<view | ||
class="at-noticebar__content" | ||
> | ||
<view | ||
class="at-noticebar__content-text" | ||
> | ||
<view | ||
animation="[object Object]" | ||
class="at-noticebar__content-inner" | ||
> | ||
这是内容 | ||
</view> | ||
</view> | ||
</view> | ||
</view> | ||
`; | ||
|
||
exports[`AtNoticebar Snap render AtNoticebar -- props speed 1`] = ` | ||
<view | ||
class="at-noticebar" | ||
> | ||
<view | ||
class="at-noticebar__content" | ||
> | ||
<view | ||
class="at-noticebar__content-text" | ||
> | ||
<view | ||
animation="[object Object]" | ||
class="at-noticebar__content-inner" | ||
> | ||
这是内容 | ||
</view> | ||
</view> | ||
</view> | ||
</view> | ||
`; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { mount } from '@vue/test-utils' | ||
import AtNoticebar from '../../src/components/noticebar' | ||
|
||
const factory = (values = {}, slots = { default: ['这是内容'] }) => { | ||
return mount(AtNoticebar, { | ||
slots, | ||
propsData: { ...values }, | ||
}) | ||
} | ||
|
||
describe('AtNoticebar Snap', () => { | ||
it('render AtNoticebar -- props show', () => { | ||
const wrapper = factory({ close: true }) | ||
expect(wrapper.element).toMatchSnapshot() | ||
}) | ||
|
||
it('render AtNoticebar -- props single', () => { | ||
const wrapper = factory({ single: true }) | ||
expect(wrapper.element).toMatchSnapshot() | ||
}) | ||
|
||
it('render AtNoticebar -- props speed', () => { | ||
const wrapper = factory({ speed: 200 }) | ||
expect(wrapper.element).toMatchSnapshot() | ||
}) | ||
|
||
it('render AtNoticebar -- props moreText & showMore', () => { | ||
// showMore work only when single is true | ||
const wrapper = factory({ moreText: '查看更多', showMore: true, single: true }) | ||
expect(wrapper.element).toMatchSnapshot() | ||
}) | ||
|
||
it('render AtNoticebar -- props icon', () => { | ||
const wrapper = factory({ icon: 'volume-plus' }) | ||
expect(wrapper.element).toMatchSnapshot() | ||
}) | ||
}) | ||
|
||
describe('AtNoticebar Event', () => { | ||
it('AtNoticebar onClose', () => { | ||
const onClose = jest.fn() | ||
const wrapper = factory({ | ||
close: true, | ||
onClose: onClose, | ||
}) | ||
wrapper.find('.at-noticebar__close').trigger('tap') | ||
expect(onClose).toBeCalled() | ||
}) | ||
|
||
it('AtNoticebar onGotoMore', () => { | ||
const onGotoMore = jest.fn() | ||
const wrapper = factory({ | ||
icon: 'volume-plus', | ||
single: true, | ||
showMore: true, | ||
onGotoMore: onGotoMore, | ||
moreText: '更多内容', | ||
}) | ||
wrapper.find('.at-noticebar__more').trigger('tap') | ||
expect(onGotoMore).toBeCalled() | ||
}) | ||
}) |