Skip to content

Commit

Permalink
chore: update test
Browse files Browse the repository at this point in the history
  • Loading branch information
HelKyle committed Sep 8, 2022
1 parent 78b9a4a commit 9873a9f
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 5 deletions.
2 changes: 1 addition & 1 deletion site/web/test-coverage.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 39 additions & 3 deletions src/tab-bar/__test__/__snapshots__/index.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,19 @@ exports[`TabBar > props > snapshot 1`] = `
1
</div>
icon
<svg
class="t-icon t-icon-app"
fill="none"
height="1em"
viewBox="0 0 16 16"
width="1em"
>
<path
d="M11.25 1.75a3 3 0 100 6 3 3 0 000-6zm-2 3a2 2 0 114 0 2 2 0 01-4 0zM2 3a1 1 0 011-1h3.5a1 1 0 011 1v3.5a1 1 0 01-1 1H3a1 1 0 01-1-1V3zm1 0v3.5h3.5V3H3zM2 9.5a1 1 0 011-1h3.5a1 1 0 011 1V13a1 1 0 01-1 1H3a1 1 0 01-1-1V9.5zm1 0V13h3.5V9.5H3zM8.5 9.5a1 1 0 011-1H13a1 1 0 011 1V13a1 1 0 01-1 1H9.5a1 1 0 01-1-1V9.5zm1 3.5H13V9.5H9.5V13z"
fill="currentColor"
fill-opacity="0.9"
/>
</svg>
</div>
</div>
Expand Down Expand Up @@ -65,7 +77,19 @@ exports[`TabBar > props > snapshot 1`] = `
1
</div>
icon
<svg
class="t-icon t-icon-app"
fill="none"
height="1em"
viewBox="0 0 16 16"
width="1em"
>
<path
d="M11.25 1.75a3 3 0 100 6 3 3 0 000-6zm-2 3a2 2 0 114 0 2 2 0 01-4 0zM2 3a1 1 0 011-1h3.5a1 1 0 011 1v3.5a1 1 0 01-1 1H3a1 1 0 01-1-1V3zm1 0v3.5h3.5V3H3zM2 9.5a1 1 0 011-1h3.5a1 1 0 011 1V13a1 1 0 01-1 1H3a1 1 0 01-1-1V9.5zm1 0V13h3.5V9.5H3zM8.5 9.5a1 1 0 011-1H13a1 1 0 011 1V13a1 1 0 01-1 1H9.5a1 1 0 01-1-1V9.5zm1 3.5H13V9.5H9.5V13z"
fill="currentColor"
fill-opacity="0.9"
/>
</svg>
</div>
</div>
Expand Down Expand Up @@ -100,7 +124,19 @@ exports[`TabBar > props > snapshot 1`] = `
1
</div>
icon
<svg
class="t-icon t-icon-app"
fill="none"
height="1em"
viewBox="0 0 16 16"
width="1em"
>
<path
d="M11.25 1.75a3 3 0 100 6 3 3 0 000-6zm-2 3a2 2 0 114 0 2 2 0 01-4 0zM2 3a1 1 0 011-1h3.5a1 1 0 011 1v3.5a1 1 0 01-1 1H3a1 1 0 01-1-1V3zm1 0v3.5h3.5V3H3zM2 9.5a1 1 0 011-1h3.5a1 1 0 011 1V13a1 1 0 01-1 1H3a1 1 0 01-1-1V9.5zm1 0V13h3.5V9.5H3zM8.5 9.5a1 1 0 011-1H13a1 1 0 011 1V13a1 1 0 01-1 1H9.5a1 1 0 01-1-1V9.5zm1 3.5H13V9.5H9.5V13z"
fill="currentColor"
fill-opacity="0.9"
/>
</svg>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/tab-bar/__test__/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { mount } from '@vue/test-utils';
import TabBar from '../tab-bar.vue'
import TabBarItem from '../tab-bar-item.vue'
import { nextTick, ref } from 'vue';
import { AppIcon as TIconApp } from 'tdesign-icons-vue-next';

const list = [
{
Expand Down Expand Up @@ -89,12 +90,13 @@ describe('TabBar', () => {
})

it ('snapshot', () => {
const icon = () => <TIconApp />
const wrapper = mount({
render: () => (
<TabBar>
{
list.map((item) => {
return <TabBarItem {...item} icon="icon" badgeProps={{count: 1}} />
return <TabBarItem {...item} icon={icon} badgeProps={{count: 1}} />
})
}
</TabBar>
Expand Down

0 comments on commit 9873a9f

Please sign in to comment.