Skip to content

Commit

Permalink
test(badge): update snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeJim committed Nov 21, 2022
1 parent 136e348 commit 0d53d93
Show file tree
Hide file tree
Showing 2 changed files with 132 additions and 1 deletion.
131 changes: 131 additions & 0 deletions src/badge/__test__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,57 @@ exports[`Badge Badge cell demo works fine 1`] = `
</cell>
`;

exports[`Badge Badge size demo works fine 1`] = `
<size>
<wx-view
class="demo-desc"
>
Large
</wx-view>
<wx-view
class="block"
>
<t-badge
count="12"
offset="{{
Array [
10,
7,
]
}}"
size="large"
>
<t-avatar
icon="user"
size="large"
/>
</t-badge>
</wx-view>
<wx-view
class="demo-desc"
>
Middle
</wx-view>
<wx-view
class="block"
>
<t-badge
count="12"
offset="{{
Array [
6,
5,
]
}}"
>
<t-avatar
icon="user"
/>
</t-badge>
</wx-view>
</size>
`;

exports[`Badge Badge tab-item demo works fine 1`] = `
<tab-item>
<t-tab-bar
Expand Down Expand Up @@ -211,3 +262,83 @@ exports[`Badge Badge tab-item demo works fine 1`] = `
</t-tab-bar>
</tab-item>
`;

exports[`Badge Badge theme demo works fine 1`] = `
<theme>
<wx-view
class="demo-desc"
>
圆形徽标
</wx-view>
<wx-view
class="demo-wrapper"
>
<t-badge
count="2"
>
<t-icon
name="notification"
size="24"
/>
</t-badge>
</wx-view>
<wx-view
class="demo-desc"
>
方形徽标
</wx-view>
<wx-view
class="demo-wrapper"
>
<t-badge
count="2"
shape="square"
>
<t-icon
name="notification"
size="24"
/>
</t-badge>
</wx-view>
<wx-view
class="demo-desc"
>
气泡徽标
</wx-view>
<wx-view
class="demo-wrapper"
>
<t-badge
count="领积分"
shape="bubble"
>
<t-button
icon="shop"
shape="square"
size="large"
/>
</t-badge>
</wx-view>
<wx-view
class="demo-desc"
style="margin-bottom: 32rpx"
>
角标
</wx-view>
<t-cell
title="单行标题"
>
<t-badge
count="New"
offset="{{
Array [
0,
0,
]
}}"
shape="ribbon"
slot="note"
/>
</t-cell>
</theme>
`;
2 changes: 1 addition & 1 deletion src/badge/__test__/demo.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import simulate from 'miniprogram-simulate';
import path from 'path';

const mapper = ['base', 'button', 'cell', 'tab-item'];
const mapper = ['base', 'size', 'theme'];

describe('Badge', () => {
mapper.forEach((demoName) => {
Expand Down

0 comments on commit 0d53d93

Please sign in to comment.