[improvement] Circle: support number type of size prop (#4160)

This commit is contained in:
neverland
2019-08-20 12:57:58 +08:00
committed by GitHub
parent b7244f8fa9
commit 112839984d
5 changed files with 25 additions and 7 deletions
@@ -1,5 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`size prop 1`] = `
<div class="van-circle" style="width: 100px; height: 100px;"><svg viewBox="0 0 1060 1060">
<path d="M 530 530 m 0, -500 a 500, 500 0 1, 1 0, 1000 a 500, 500 0 1, 1 0, -1000" class="van-circle__hover" style="fill: none; stroke: #fff; stroke-width: 40px;"></path>
<path d="M 530 530 m 0, -500 a 500, 500 0 1, 1 0, 1000 a 500, 500 0 1, 1 0, -1000" stroke="#1989fa" class="van-circle__layer" style="stroke: #1989fa; stroke-width: 41px; stroke-dasharray: 0px 3140px;"></path>
</svg></div>
`;
exports[`speed is 0 1`] = `
<div class="van-circle" style="width: 100px; height: 100px;"><svg viewBox="0 0 1060 1060">
<path d="M 530 530 m 0, -500 a 500, 500 0 1, 1 0, 1000 a 500, 500 0 1, 1 0, -1000" class="van-circle__hover" style="fill: none; stroke: #fff; stroke-width: 40px;"></path>
+10
View File
@@ -37,3 +37,13 @@ test('animate', async () => {
expect(onInput).toHaveBeenCalled();
expect(onInput.mock.calls[0][0]).not.toEqual(0);
});
test('size prop', () => {
const wrapper = mount(Circle, {
propsData: {
size: 100
}
});
expect(wrapper).toMatchSnapshot();
});