diff --git a/plugins/techdocs-module-addons-contrib/package.json b/plugins/techdocs-module-addons-contrib/package.json
index 531e68ad7a..35b6df715b 100644
--- a/plugins/techdocs-module-addons-contrib/package.json
+++ b/plugins/techdocs-module-addons-contrib/package.json
@@ -38,6 +38,7 @@
"@backstage/core-plugin-api": "^1.0.1",
"@backstage/integration": "^1.2.0-next.0",
"@backstage/integration-react": "^1.1.0-next.0",
+ "@backstage/plugin-techdocs-addons-test-utils": "^0.0.0",
"@backstage/plugin-techdocs-react": "^0.1.1-next.0",
"@backstage/theme": "^0.2.15",
"@material-ui/core": "^4.9.13",
diff --git a/plugins/techdocs-module-addons-contrib/src/ReportIssue/ReportIssue.test.tsx b/plugins/techdocs-module-addons-contrib/src/ReportIssue/ReportIssue.test.tsx
new file mode 100644
index 0000000000..3a05f1358e
--- /dev/null
+++ b/plugins/techdocs-module-addons-contrib/src/ReportIssue/ReportIssue.test.tsx
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2022 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { TechDocsAddonBuilder } from '@backstage/plugin-techdocs-addons-test-utils';
+
+import React from 'react';
+import { fireEvent, waitFor } from '@testing-library/react';
+
+import { scmIntegrationsApiRef } from '@backstage/integration-react';
+import { ReportIssue } from '..';
+
+const byUrl = jest.fn().mockReturnValue({ type: 'github' });
+
+const fireSelectionChangeEvent = (window: Window) => {
+ const selectionChangeEvent = window.document.createEvent('Event');
+ selectionChangeEvent.initEvent('selectionchange', true, true);
+ window.document.addEventListener('selectionchange', () => {}, false);
+ fireEvent(window.document, selectionChangeEvent);
+};
+
+describe('ReportIssue', () => {
+ const selection = {
+ type: 'Range',
+ rangeCount: 1,
+ isCollapsed: true,
+ getRangeAt: () => ({
+ startContainer: 'this is a sentence',
+ endContainer: 'this is a sentence',
+ startOffset: 1,
+ endOffset: 3,
+ getBoundingClientRect: () => ({
+ right: 100,
+ top: 100,
+ width: 100,
+ height: 100,
+ }),
+ }),
+ toString: () => 'his ',
+ containsNode: () => true,
+ } as unknown as Selection;
+
+ beforeEach(() => {
+ jest.clearAllMocks();
+ });
+
+ it('renders without exploding', async () => {
+ const { shadowRoot, getByText } =
+ await TechDocsAddonBuilder.buildAddonsInTechDocs([
+