Skip to content

Comments

fix: Response objects couldn't open#1867

Merged
Oprysk merged 2 commits intoRedocly:masterfrom
DepickereSven:response-couldn't-open
Jan 24, 2022
Merged

fix: Response objects couldn't open#1867
Oprysk merged 2 commits intoRedocly:masterfrom
DepickereSven:response-couldn't-open

Conversation

@DepickereSven
Copy link
Contributor

What/Why/How?

When you clicked on a response object you would get the following error.

Uncaught TypeError: can't access property "expanded", this is undefined

Reference

No reference

Testing

Added some cypress tests

Screenshots (optional)

Check yourself

  • Code is linted
  • Tested
  • All new/updated code is covered with tests

.should('have.attr', 'aria-expanded', 'true')
.parent()
.find('div h5')
.then($h5 => $h5[0].firstChild!.nodeValue!.trim())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to get the value of the h5 element.
If I would just do .should('have.text', 'Response Schema:') on that h5 it would throw an error. Because the span values would also be in that comparison.

@DepickereSven DepickereSven changed the title Response objects couldn't open fix: Response objects couldn't open Jan 22, 2022
@Oprysk
Copy link
Contributor

Oprysk commented Jan 24, 2022

@DepickereSven Thank you for the fix!

@Oprysk Oprysk merged commit 18f943d into Redocly:master Jan 24, 2022
@DepickereSven DepickereSven deleted the response-couldn't-open branch January 24, 2022 09:22
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