Skip to content

Commit

Permalink
fix(compiler): cannot always default to prop name (#440)
Browse files Browse the repository at this point in the history
  • Loading branch information
redgeoff authored Aug 8, 2021
1 parent f3eabc2 commit 2f88fad
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/compiler/compiler.factory.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ it('should compile when factory is in the root of the definition', () => {

factoryShouldCreateUniqueForms(formFactory);

expect(formFactory.getClassName()).toEqual('app.FormFactory');
expect(formFactory.getClassName()).toEqual('Factory');
});

it('should handle template parameters in a nested factory', () => {
Expand Down
3 changes: 0 additions & 3 deletions src/compiler/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,6 @@ export class Compiler {
// The parentProps define values for the template parameters in props and allow us to make pieces
// of our components dynamic.
compile(props, parentProps, className) {
if (className === undefined && props.name !== undefined) {
className = props.name;
}
return this._getWrappedComponentClass(
props.component,
props,
Expand Down
4 changes: 2 additions & 2 deletions src/component/mson-component.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ it('should build in constructor', () => {
it('should not preserve class name', () => {
const component = new MSONComponent({
definition: {
name: 'MyField',
name: 'name',
component: 'TextField',
},
});

expect(component.getClassName()).toEqual('MyField');
expect(component.getClassName()).toEqual('TextField');
});

it('should set and get compiler', () => {
Expand Down

0 comments on commit 2f88fad

Please sign in to comment.