Skip to content

CPLAT-7684: Finalize UiComponent2 Tests#348

Merged
rmconsole4-wk merged 20 commits into3.1.0-wipfrom
component2-test-coverage
Oct 16, 2019
Merged

CPLAT-7684: Finalize UiComponent2 Tests#348
rmconsole4-wk merged 20 commits into3.1.0-wipfrom
component2-test-coverage

Conversation

@kealjones-wk
Copy link
Contributor

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

  • over_react
    • 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
    • Specifics:
      • Add test coverage that typedPropsFactory/stateFactory handles null by falling back to a new map

Changes

Release Notes

Review

See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.

Please review:

QA Checklist

  • Tests were updated and provide good coverage of the changeset and other affected code
  • Manual testing was performed if needed

Merge Checklist

While we perform many automated checks before auto-merging, some manual checks are needed:

  • A Client Platform member has reviewed these changes
  • There are no unaddressed comments - this check can be automated if reviewers use the "Request Changes" feature
  • For release PRs - Version metadata in Rosie comment is correct

@aviary-wf
Copy link

Security Insights

No security relevant content was detected by automated scans.

Action Items

  • Review PR for security impact; comment "security review required" if needed or unsure
  • Verify aviary.yaml coverage of security relevant code

Questions or Comments? Reach out on Slack: #support-infosec.

@kealjones-wk kealjones-wk changed the title CPLAT-2276: Finalize ComponentV2 / UiComponentV2 Tests CPLAT-2276: Finalize UiComponent2 Tests Oct 4, 2019
- Add check that validates functionality is retained
@kealjones-wk kealjones-wk changed the title CPLAT-2276: Finalize UiComponent2 Tests CPLAT-7684: Finalize UiComponent2 Tests Oct 7, 2019
@kealjones-wk kealjones-wk marked this pull request as ready for review October 8, 2019 00:00
* 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>());
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious... why not use isA< TestStatefulComponent2State >() instead of const TypeMatcher?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because i didn't write this test and just copy/pasted the tests above it and updated them to use UiComponet2. lol

Comment on lines +1089 to +1090
expect(newState1, const TypeMatcher<TestStatefulComponent2State>());
expect(newState2, const TypeMatcher<TestStatefulComponent2State>());
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like we're using isA<...>() elsewhere in Dart2-only libs since it is the recommended replacement for const isInstanceOf<...>().

kealjones-wk and others added 6 commits October 10, 2019 15:05
Co-Authored-By: sydneyjodon-wk <51122966+sydneyjodon-wk@users.noreply.github.com>
Co-Authored-By: Aaron Lademann <aaron.lademann@workiva.com>
* 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`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make Dummy2Component and its props/factory private, then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

grosss lol. shitty boilerplate ftl

Copy link
Contributor Author

Choose a reason for hiding this comment

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

_$_

}

testComponentTypeChecking({
isComponent2: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

This should have typing

Suggested change
isComponent2: false,
bool isComponent2: false,


testComponentTypeChecking({
isComponent2: false,
TestParent,
Copy link
Contributor

Choose a reason for hiding this comment

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

These should also be typed

Suggested change
TestParent,
UiFactory TestParent,

and so on

@Component(isWrapper: true)
class OneLevelWrapper2Component extends UiComponent<OneLevelWrapper2Props> {
@Component2(isWrapper: true)
class OneLevelWrapper2Component extends UiComponent2<OneLevelWrapper2Props> {
Copy link
Contributor

Choose a reason for hiding this comment

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

😬 Nice catch!!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lulz thanks

expect(declarations.state.meta.keyNamespace, 'baz');
expect(declarations.component.meta.isWrapper, isTrue);
});
test('a stateful Component2', () {
Copy link
Contributor

Choose a reason for hiding this comment

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

#nit could use a newline before this

Suggested change
test('a stateful Component2', () {
test('a stateful Component2', () {

Copy link
Contributor

@greglittlefield-wf greglittlefield-wf left a comment

Choose a reason for hiding this comment

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

+10

@greglittlefield-wf
Copy link
Contributor

@Workiva/release-management-p

@kealjones-wk
Copy link
Contributor Author

+1

@rmconsole4-wk rmconsole4-wk merged commit 683f7d3 into 3.1.0-wip Oct 16, 2019
@rmconsole4-wk rmconsole4-wk deleted the component2-test-coverage branch October 16, 2019 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants