Skip to content

Conversation

@dpilch
Copy link
Contributor

@dpilch dpilch commented Oct 28, 2021

  • fix simple property binding default
    Previously these default values were not honored.
    Example:
// previous:
const { label } = props;
// fixed
const { label: 'Default Value' } = props;
  • add integ test default values
  • enhance template watch script to rebuild test-generator on changes

I've copied the same components from integ to snapshot tests for default value cases. In the future we can improve how components are shared between these packages, but for now it is duplicated.

To Do in separate PR

  • Add integ test for default value for collection bound properties. (Requires model type fix).

@dpilch dpilch force-pushed the default-value branch 2 times, most recently from b24bcde to ab69bf6 Compare October 28, 2021 17:45
@dpilch dpilch marked this pull request as ready for review October 28, 2021 17:46
case 'Boolean':
return JSON.parse(binding.defaultValue) ? factory.createTrue() : factory.createFalse();
default:
throw new Error('something');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably a more helpful error, like could not parse binding with type ${binding.type}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol oops, was a placeholder then forgot to update.

Copy link
Contributor

@alharris-at alharris-at left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM - just the one comment on that error string

@dpilch dpilch merged commit de84261 into main Oct 28, 2021
@dpilch dpilch deleted the default-value branch October 28, 2021 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants