Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit d51695a

Browse files
committed
test(button): add snapshot test
1 parent c30ca40 commit d51695a

File tree

3 files changed

+48
-6
lines changed

3 files changed

+48
-6
lines changed

nodemon.json

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`should render properly 1`] = `
4+
<DocumentFragment>
5+
<div
6+
class="chakra-button__group css-p4lcqj"
7+
label="button__group"
8+
role="group"
9+
>
10+
<button
11+
class="chakra-button css-kb8k9p"
12+
label="button"
13+
>
14+
Save
15+
</button>
16+
<button
17+
class="chakra-button css-1vxhs68"
18+
label="button"
19+
>
20+
Cancel
21+
</button>
22+
</div>
23+
</DocumentFragment>
24+
`;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { render } from '../../test-utils/src'
2+
import { CButtonGroup, CButton } from '../src'
3+
4+
const renderComponent = (props?: any) => {
5+
const base = {
6+
components: {
7+
CButtonGroup,
8+
CButton,
9+
},
10+
template: `
11+
<c-button-group variant="outline">
12+
<c-button color-scheme="blue">Save</c-button>
13+
<c-button>Cancel</c-button>
14+
</c-button-group>
15+
`,
16+
...props,
17+
}
18+
return render(base)
19+
}
20+
21+
it('should render properly', () => {
22+
const { asFragment } = renderComponent()
23+
expect(asFragment()).toMatchSnapshot()
24+
})

0 commit comments

Comments
 (0)