fix to make test-utils work without h1 in dom
Co-authored-by: Camila Belo <camilaibs@gmail.com> Co-authored-by: Eric Peterson <iamEAP@users.noreply.github.com> Signed-off-by: Anders Näsman <andersn@spotify.com>
This commit is contained in:
@@ -48,8 +48,9 @@ export const addGitFeedbackLink = (
|
||||
}
|
||||
|
||||
// topmost h1 only contains title for whole page
|
||||
const title = (dom.querySelector('article>h1') as HTMLElement).childNodes[0]
|
||||
.textContent;
|
||||
const title =
|
||||
(dom.querySelector('article>h1') as HTMLElement)?.childNodes[0]
|
||||
.textContent || '';
|
||||
const issueTitle = encodeURIComponent(`Documentation Feedback: ${title}`);
|
||||
const issueDesc = encodeURIComponent(
|
||||
`Page source:\n${sourceAnchor.href}\n\nFeedback:`,
|
||||
|
||||
Reference in New Issue
Block a user