Skip to content

Conversation

@priscilawebdev
Copy link
Member

@priscilawebdev priscilawebdev commented Sep 3, 2021

closes: INGEST-314

Added tests for the mobile screenshot feature. Related PRs:

#28309
#27350
#27274
#27228

* Search for a text broken up by multiple html elements
* e.g.: <div>Hello <span>world</span></div>
*/
export async function findByTextContent(
Copy link
Member Author

Choose a reason for hiding this comment

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

I think in the future we will have more utilities in this file

);
}

describe('StackTrace', function () {
Copy link
Member Author

Choose a reason for hiding this comment

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

this should not be part of this PR, but I could not resist, pls lmk if that is fine 😄


return (
<Role role={organization.attachmentsRole}>
<Role organization={organization} role={organization.attachmentsRole}>
Copy link
Member Author

Choose a reason for hiding this comment

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

the Role component is already wrapped with withOrganization but passing the org here was needed for the test to work. It was the simplest solution


if (!tags.length && !hasContext && isShare) {
const screenshot = attachments.find(
({name}) => name === 'screenshot.jpg' || name === 'screenshot.png'
Copy link
Member Author

Choose a reason for hiding this comment

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

this new condition is described in the draft PR: getsentry/develop#422

@priscilawebdev priscilawebdev requested review from a team and bruno-garcia September 3, 2021 07:40
textMatch: string | RegExp
): Promise<HTMLElement> {
return screen.findByText((_, contentNode) => {
const hasText = (node: Element) => node.textContent === textMatch;
Copy link
Member

Choose a reason for hiding this comment

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

Would you be able to use node.innerText to search the element and the text of its children?

Copy link
Member Author

Choose a reason for hiding this comment

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

It seems that innerText is not implemented in jsdom.. see here.

@priscilawebdev priscilawebdev enabled auto-merge (squash) September 7, 2021 08:52
@priscilawebdev priscilawebdev merged commit 92ab0bc into master Sep 7, 2021
@priscilawebdev priscilawebdev deleted the feat/add-mobile-screenshots-tests branch September 7, 2021 08:53
@github-actions github-actions bot locked and limited conversation to collaborators Sep 22, 2021
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.

4 participants