CPLAT-7684: Finalize UiComponent2 Tests#348
Conversation
Security InsightsNo security relevant content was detected by automated scans. Action Items
Questions or Comments? Reach out on Slack: #support-infosec. |
- Deprecate registerAbstractComponent - Add DummyComponent2 - Update some tests
- Add check that validates functionality is retained
…izeState add component_base_2 tests
* 3.1.0-wip: Restore 5.1.0-wip dependency override Update version string Update component references to Component2 Bump lower bound of over_react_test Widen react alpha dependency range Bump lower bound of w_flux Update version string / changelog Remove react dependency override Bump lower bound of react dependency Export TypedSnapshot
| group('`state`', () { | ||
| group('getter:', () { | ||
| test('returns a UiState view into the component\'s state map', () { | ||
| expect(statefulComponent.state, const TypeMatcher<TestStatefulComponent2State>()); |
There was a problem hiding this comment.
Just curious... why not use isA< TestStatefulComponent2State >() instead of const TypeMatcher?
There was a problem hiding this comment.
because i didn't write this test and just copy/pasted the tests above it and updated them to use UiComponet2. lol
| expect(newState1, const TypeMatcher<TestStatefulComponent2State>()); | ||
| expect(newState2, const TypeMatcher<TestStatefulComponent2State>()); |
There was a problem hiding this comment.
I feel like we're using isA<...>() elsewhere in Dart2-only libs since it is the recommended replacement for const isInstanceOf<...>().
test/over_react/component_declaration/component2_type_checking_test/test_a.dart
Outdated
Show resolved
Hide resolved
Co-Authored-By: sydneyjodon-wk <51122966+sydneyjodon-wk@users.noreply.github.com> Co-Authored-By: Aaron Lademann <aaron.lademann@workiva.com>
- Long Live isA!
…/over_react into component2-test-coverage
* 3.1.0-wip: Uncomment built_value_generator Bump analyzer top constraint over_react 3.0.0-alpha.1+dart2 Improve readability of large function body Fix null aware assignment typo Move var closer to usage Reset internal error tracking immediately Address documentation CR feedback Use a managed timer Update SvgProp typing Change open to a bool Improve handling of “repeat” errors that can lock up the main thread Don't use package for builder import make local builder private
| // UiComponent2Bridge and it's jsifyPropTypes implementation require a UiComponent2, | ||
| // and cannot simply be a react.Component2 class. | ||
| // | ||
| // This is to publicly expose the generated component type for use with `registerAbstractComponent2`. |
There was a problem hiding this comment.
Can we make Dummy2Component and its props/factory private, then?
There was a problem hiding this comment.
grosss lol. shitty boilerplate ftl
| } | ||
|
|
||
| testComponentTypeChecking({ | ||
| isComponent2: false, |
There was a problem hiding this comment.
This should have typing
| isComponent2: false, | |
| bool isComponent2: false, |
|
|
||
| testComponentTypeChecking({ | ||
| isComponent2: false, | ||
| TestParent, |
There was a problem hiding this comment.
These should also be typed
| TestParent, | |
| UiFactory TestParent, |
and so on
| @Component(isWrapper: true) | ||
| class OneLevelWrapper2Component extends UiComponent<OneLevelWrapper2Props> { | ||
| @Component2(isWrapper: true) | ||
| class OneLevelWrapper2Component extends UiComponent2<OneLevelWrapper2Props> { |
| expect(declarations.state.meta.keyNamespace, 'baz'); | ||
| expect(declarations.component.meta.isWrapper, isTrue); | ||
| }); | ||
| test('a stateful Component2', () { |
There was a problem hiding this comment.
#nit could use a newline before this
| test('a stateful Component2', () { | |
| test('a stateful Component2', () { |
|
@Workiva/release-management-p |
|
+1 |
Motivation
Review tests for new UiComponent2 functionality, and ensure that there is no missing test coverage, and that all tests for UiComponent have mirrored tests for UiComponent2
AC
typedPropsFactory/stateFactory handlesnullby falling back to a new mapChanges
Release Notes
Review
See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.
Please review:
QA Checklist
Merge Checklist
While we perform many automated checks before auto-merging, some manual checks are needed: