Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

Fix: Don't display measureTable when measures is empty #341

Merged
merged 1 commit into from
Dec 10, 2018

Conversation

kagehina919
Copy link
Contributor

Added patch for #335.

I have added test for the same but the generated snapshot doesn't contain measureTable component. I've used mount instead of shallow rendering.

@wlach could you please help me with this?

Copy link
Contributor

@wlach wlach left a comment

Choose a reason for hiding this comment

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

Thanks for digging into this!

Some minor feedback on the implementation.

For the tests, I am not entirely sure offhand. I must admit that the redux/jest workflow is kind of complex here. :/ Offhand your approach looks approximately correct, so I'm not sure what's gone wrong. What I normally do in this situation is insert a bunch of console.logs to try and understand what the system is doing and where data is flowing. Let me know if that helps -- if you can't figure it out let me know and I'll take a closer look.

versions={this.props.versions}
subviewState={this.state}
/>
{this.displayMeasuresTable()}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think there's any need to delegate this to a method. I would keep this logic inline, and just do something like:

{
  this.state.measures.crashMeasures.length && (
    <MeasureTable
      title="Crash Measures"
      measures={this.state.measures.crashMeasures}
      versions={this.props.versions}
      subviewState={this.state}
     />)
}

(repeat this pattern for otherMeasures)

@kagehina919
Copy link
Contributor Author

kagehina919 commented Dec 2, 2018

@wlach The tests are were failing as the promise required for this.props.fetchChannelPlatformSummaryData() is was not being resolved until after the tests have run.

@kagehina919 kagehina919 force-pushed the jest branch 2 times, most recently from 91b416b to 07e7f88 Compare December 3, 2018 19:42
@kagehina919 kagehina919 changed the title [WIP] Fix: Don't display measureTable when measures is empty Fix: Don't display measureTable when measures is empty Dec 3, 2018
@kagehina919
Copy link
Contributor Author

@wlach issue fixed. Please review.

@kagehina919
Copy link
Contributor Author

@wlach could you please take a look at this? 😅

@wlach
Copy link
Contributor

wlach commented Dec 9, 2018 via email

@wlach
Copy link
Contributor

wlach commented Dec 10, 2018

This looks and works great! I will merge.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants