aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/components/docs
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/components/docs')
-rw-r--r--server/sonar-web/src/main/js/components/docs/DocTooltip.tsx11
-rw-r--r--server/sonar-web/src/main/js/components/docs/__tests__/DocLink-test.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/docs/__tests__/__snapshots__/DocLink-test.tsx.snap9
3 files changed, 11 insertions, 11 deletions
diff --git a/server/sonar-web/src/main/js/components/docs/DocTooltip.tsx b/server/sonar-web/src/main/js/components/docs/DocTooltip.tsx
index a1cfb5d2150..d3f096a8957 100644
--- a/server/sonar-web/src/main/js/components/docs/DocTooltip.tsx
+++ b/server/sonar-web/src/main/js/components/docs/DocTooltip.tsx
@@ -34,12 +34,11 @@ interface Props {
interface State {
content?: string;
- open: boolean;
}
export default class DocTooltip extends React.PureComponent<Props, State> {
mounted = false;
- state: State = { open: false };
+ state: State = {};
componentDidMount() {
this.mounted = true;
@@ -51,20 +50,12 @@ export default class DocTooltip extends React.PureComponent<Props, State> {
},
() => {}
);
- document.addEventListener('scroll', this.close, true);
}
componentWillUnmount() {
this.mounted = false;
- document.removeEventListener('scroll', this.close, true);
}
- close = () => {
- if (this.mounted) {
- this.setState({ open: false });
- }
- };
-
render() {
return this.state.content ? (
<HelpTooltip
diff --git a/server/sonar-web/src/main/js/components/docs/__tests__/DocLink-test.tsx b/server/sonar-web/src/main/js/components/docs/__tests__/DocLink-test.tsx
index e51e1841ace..71e0e920a24 100644
--- a/server/sonar-web/src/main/js/components/docs/__tests__/DocLink-test.tsx
+++ b/server/sonar-web/src/main/js/components/docs/__tests__/DocLink-test.tsx
@@ -116,7 +116,7 @@ it('should not render sonarqube admin link on sonarcloud', () => {
expect(wrapper.find('SonarQubeAdminLink').dive()).toMatchSnapshot();
});
-it.skip('should render documentation anchor', () => {
+it('should render documentation anchor', () => {
expect(
shallow(
<DocLink appState={{ canAdmin: false }} href="#quality-profiles">
diff --git a/server/sonar-web/src/main/js/components/docs/__tests__/__snapshots__/DocLink-test.tsx.snap b/server/sonar-web/src/main/js/components/docs/__tests__/__snapshots__/DocLink-test.tsx.snap
index 06a3ff51156..3b3db3ba938 100644
--- a/server/sonar-web/src/main/js/components/docs/__tests__/__snapshots__/DocLink-test.tsx.snap
+++ b/server/sonar-web/src/main/js/components/docs/__tests__/__snapshots__/DocLink-test.tsx.snap
@@ -24,6 +24,15 @@ exports[`should not render sonarqube link on sonarcloud 1`] = `
</Fragment>
`;
+exports[`should render documentation anchor 1`] = `
+<a
+ href="#"
+ onClick={[Function]}
+>
+ link text
+</a>
+`;
+
exports[`should render documentation link 1`] = `
<Link
onlyActiveOnIndex={false}