This repository has been archived by the owner on Oct 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
72 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`AtFab Event AtFab onClick 1`] = ` | ||
<view | ||
class="at-fab at-fab--normal" | ||
onClick="function () { | ||
return fn.apply(this, arguments); | ||
}" | ||
> | ||
按钮 | ||
</view> | ||
`; | ||
|
||
exports[`AtFab Snap render AtFab -- default props 1`] = ` | ||
<view | ||
class="at-fab at-fab--normal" | ||
> | ||
按钮 | ||
</view> | ||
`; | ||
|
||
exports[`AtFab Snap render AtFab -- props className 1`] = ` | ||
<view | ||
class="at-fab button at-fab--normal" | ||
> | ||
按钮 | ||
</view> | ||
`; | ||
|
||
exports[`AtFab Snap render AtFab -- props size small 1`] = ` | ||
<view | ||
class="at-fab at-fab--small" | ||
> | ||
按钮 | ||
</view> | ||
`; |
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,36 @@ | ||
import { mount } from '@vue/test-utils' | ||
import AtFab from '../../src/components/fab' | ||
|
||
const factory = (values = {}, slots = { default: ['按钮'] }) => { | ||
return mount(AtFab, { | ||
components: {}, | ||
slots, | ||
propsData: { ...values }, | ||
}) | ||
} | ||
|
||
describe('AtFab Snap', () => { | ||
it('render AtFab -- default props', () => { | ||
const wrapper = factory() | ||
expect(wrapper.element).toMatchSnapshot() | ||
}) | ||
|
||
it('render AtFab -- props className', () => { | ||
const wrapper = factory({ className: 'button' }) | ||
expect(wrapper.element).toMatchSnapshot() | ||
}) | ||
|
||
it('render AtFab -- props size small', () => { | ||
const wrapper = factory({ size: 'small' }) | ||
expect(wrapper.element).toMatchSnapshot() | ||
}) | ||
}) | ||
|
||
describe('AtFab Event', () => { | ||
it('AtFab onClick', () => { | ||
const onClick = jest.fn() | ||
const wrapper = factory({ onClick: onClick }) | ||
wrapper.find('.at-fab').trigger('tap') | ||
expect(wrapper.element).toMatchSnapshot() | ||
}) | ||
}) |