Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compiler): cannot always default to prop name #440

Merged
merged 1 commit into from
Aug 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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