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

Commit 2fc3605

Browse files
Merge branch 'develop' into release/css-props
2 parents 4379082 + 5befbf5 commit 2fc3605

File tree

6 files changed

+845
-4
lines changed

6 files changed

+845
-4
lines changed

.all-contributorsrc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@
162162
"avatar_url": "https://avatars3.githubusercontent.com/u/15808?v=4",
163163
"profile": "https://github.com/freality",
164164
"contributions": [
165-
"code"
165+
"code",
166+
"test"
166167
]
167168
},
168169
{
@@ -173,6 +174,15 @@
173174
"contributions": [
174175
"code"
175176
]
177+
},
178+
{
179+
"login": "be-codified",
180+
"name": "Žiga Vukčevič",
181+
"avatar_url": "https://avatars1.githubusercontent.com/u/10107183?v=4",
182+
"profile": "http://www.be-codified.com",
183+
"contributions": [
184+
"doc"
185+
]
176186
}
177187
],
178188
"contributorsPerLine": 7,

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
211211
<tr>
212212
<td align="center"><a href="https://github.com/Anmol270900"><img src="https://avatars2.githubusercontent.com/u/43845658?v=4" width="50px;" alt=""/><br /><sub><b>Anmol</b></sub></a><br /><a href="https://github.com/chakra-ui/chakra-ui-vue/commits?author=Anmol270900" title="Documentation">📖</a></td>
213213
<td align="center"><a href="https://github.com/vishnumohanrk"><img src="https://avatars3.githubusercontent.com/u/51525368?v=4" width="50px;" alt=""/><br /><sub><b>Vishnumohan R K</b></sub></a><br /><a href="https://github.com/chakra-ui/chakra-ui-vue/commits?author=vishnumohanrk" title="Documentation">📖</a></td>
214-
<td align="center"><a href="https://github.com/freality"><img src="https://avatars3.githubusercontent.com/u/15808?v=4" width="50px;" alt=""/><br /><sub><b>Ken Love</b></sub></a><br /><a href="https://github.com/chakra-ui/chakra-ui-vue/commits?author=freality" title="Code">💻</a></td>
214+
<td align="center"><a href="https://github.com/freality"><img src="https://avatars3.githubusercontent.com/u/15808?v=4" width="50px;" alt=""/><br /><sub><b>Ken Love</b></sub></a><br /><a href="https://github.com/chakra-ui/chakra-ui-vue/commits?author=freality" title="Code">💻</a> <a href="https://github.com/chakra-ui/chakra-ui-vue/commits?author=freality" title="Tests">⚠️</a></td>
215215
<td align="center"><a href="http://www.linkedin.com/in/schalch"><img src="https://avatars3.githubusercontent.com/u/13435327?v=4" width="50px;" alt=""/><br /><sub><b>Guilherme Schalch</b></sub></a><br /><a href="https://github.com/chakra-ui/chakra-ui-vue/commits?author=gbschalch" title="Code">💻</a></td>
216+
<td align="center"><a href="http://www.be-codified.com"><img src="https://avatars1.githubusercontent.com/u/10107183?v=4" width="50px;" alt=""/><br /><sub><b>Žiga Vukčevič</b></sub></a><br /><a href="https://github.com/chakra-ui/chakra-ui-vue/commits?author=be-codified" title="Documentation">📖</a></td>
216217
</tr>
217218
</table>
218219

packages/chakra-ui-core/src/CReset/CReset.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@ const CReset = {
5151
}
5252
},
5353
props: {
54-
config: Function
54+
config: {
55+
type: Function,
56+
validator (value) {
57+
return typeof value === 'function'
58+
}
59+
}
5560
},
5661
created () {
5762
const { color, bg, borderColor, placeholderColor } = this.styleConfig[this.colorMode]
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import CReset from '../'
2+
import { render } from '@/tests/test-utils'
3+
4+
const renderComponent = (props) => {
5+
const inlineAttrs = (props && props.inlineAttrs) || ''
6+
const base = {
7+
components: { CReset },
8+
template: `<CReset data-testid="reset" ${inlineAttrs} />`,
9+
...props
10+
}
11+
return render(base)
12+
}
13+
14+
describe('CReset.vue', () => {
15+
it('should render correctly', () => {
16+
const { asFragment } = renderComponent()
17+
18+
expect(asFragment()).toMatchSnapshot()
19+
})
20+
21+
it('should inject global styles', () => {
22+
renderComponent()
23+
24+
expect(document.head).toMatchSnapshot()
25+
})
26+
27+
it('should accept config prop', () => {
28+
const inlineAttrs = ':config="cssResetConfig"'
29+
const cssResetConfig = (_, defaults) => {
30+
const { light } = defaults
31+
return {
32+
...defaults, light: { ...light, bg: 'pink', color: 'indigo' }
33+
}
34+
}
35+
36+
renderComponent({ inlineAttrs, methods: { cssResetConfig } })
37+
38+
expect(document.head).toMatchSnapshot()
39+
})
40+
})

0 commit comments

Comments
 (0)