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

#292 | Service Check - Add diff on expected vs actual body #402

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mGasiorek998
Copy link
Collaborator

#292 Widget | Service Check - Add diff on expected vs actual body

Description

Added split view for Request and Expected Response body when Responses do not match.

Motivation and Context

Thanks to split view user will be able to quickly diagnose what was expected and what was recived.

Screenshots (if appropriate)

Capture

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • Automated functional tests have been added or modified to cover my changes (if applicable)
  • I have updated the documentation accordingly.

I hereby agree to the terms of the Cogboard Contributor License Agreement.

@mGasiorek998 mGasiorek998 changed the title Added Split View on Expected and Recived Request body in Service Chec… #292 Widget | Service Check - Add diff on expected vs actual body Jun 22, 2021
@mGasiorek998 mGasiorek998 linked an issue Jun 22, 2021 that may be closed by this pull request
@mGasiorek998 mGasiorek998 self-assigned this Jun 23, 2021
{bodyMessage === 'NO MATCH' ? (
<StyledPopoverTextWrapper>
<StyledPopoverText>
<StyledPopoverHeader>EXPECTED RESPONSE BODY</StyledPopoverHeader>
Copy link
Contributor

Choose a reason for hiding this comment

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

just EXPECTED RESPONSE and ACTUAL RESPONSE

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah and please move this to const too

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in commit 297f448

@szymon-owczarzak szymon-owczarzak added the enhancement New feature or request label Jun 23, 2021
@szymon-owczarzak szymon-owczarzak changed the title #292 Widget | Service Check - Add diff on expected vs actual body #292 | Service Check - Add diff on expected vs actual body Jun 23, 2021
@@ -39,7 +46,20 @@ export const PopoverWithControls = ({
>
{withCopy ? <Button onClick={copyBody}>Copy</Button> : null}
<Button onClick={handlePopoverClose}>Close</Button>
<StyledPopoverText>{body}</StyledPopoverText>
{bodyMessage === 'NO MATCH' ? (
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can move 'NO MATCH' string to const

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in commit 297f448

{expectedResponseBody}
</StyledPopoverText>
<StyledPopoverText>
<StyledPopoverHeader>RECIVED RESPONSE BODY</StyledPopoverHeader>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess you wanted to write 'RECEIVED' here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in commit 297f448

@@ -128,12 +128,29 @@ export const StyledFormControl = styled(FormControl)`
max-width: 300px;
`;

export const StyledPopoverText = styled(Typography)`
export const StyledPopoverText = styled('div')`
Copy link
Collaborator

Choose a reason for hiding this comment

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

When you create a styled component for html selector you can simply write

Suggested change
export const StyledPopoverText = styled('div')`
export const StyledPopoverText = styled.div`

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in commit 297f448

YellowFlash525
YellowFlash525 previously approved these changes Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Widget | Service Check - Add diff on expected vs actual body
4 participants