Skip to content

Commit ca2a745

Browse files
committed
refactor(createStyledComponent): removed taget checks
feat(tests): restored skipped tests
1 parent d62ee9a commit ca2a745

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/models/StyledComponent.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import css from '../constructors/css'
22
import normalizeProps from '../utils/normalizeProps'
3-
import isVueComponent from '../utils/isVueComponent'
43

54
export default (ComponentStyle) => {
65
const createStyledComponent = (target, rules, props) => {
@@ -38,9 +37,9 @@ export default (ComponentStyle) => {
3837
children.push(createElement('template', { slot }, this.$slots[slot]))
3938
}
4039
}
41-
const element = this.$props.as
40+
4241
return createElement(
43-
isVueComponent(target) ? target : element || target,
42+
this.$props.as || target,
4443
{
4544
class: [this.generatedClassName],
4645
props: this.$props,

src/test/extending-components.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ describe('extending components', () => {
7878
expectCSSMatches('.a {color: blue;}.a > h1 {font-size: 4rem;} .b {color: red;}')
7979
})
8080

81-
// Skipped because test fails
82-
xit('should keep default props from parent', () => {
81+
it('should keep default props from parent', () => {
8382
const parentProps = {
8483
color: {
8584
type: String,

0 commit comments

Comments
 (0)