aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/components
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/components')
-rw-r--r--server/sonar-web/src/main/js/components/SourceViewer/helpers/__tests__/duplications-test.ts2
-rw-r--r--server/sonar-web/src/main/js/components/activity-graph/__tests__/utils-test.ts6
-rw-r--r--server/sonar-web/src/main/js/components/controls/DateRangeInput.tsx1
-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
-rw-r--r--server/sonar-web/src/main/js/components/facet/__tests__/ListStyleFacet-test.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/facet/__tests__/MultipleSelectionHint-test.tsx4
-rw-r--r--server/sonar-web/src/main/js/components/hoc/__tests__/whenLoggedIn-test.tsx2
9 files changed, 19 insertions, 20 deletions
diff --git a/server/sonar-web/src/main/js/components/SourceViewer/helpers/__tests__/duplications-test.ts b/server/sonar-web/src/main/js/components/SourceViewer/helpers/__tests__/duplications-test.ts
index 6944be9c6af..1c11aeb8846 100644
--- a/server/sonar-web/src/main/js/components/SourceViewer/helpers/__tests__/duplications-test.ts
+++ b/server/sonar-web/src/main/js/components/SourceViewer/helpers/__tests__/duplications-test.ts
@@ -32,7 +32,7 @@ describe('getDuplicationBlocksForIndex', () => {
});
describe('isDuplicationBlockInRemovedComponent', () => {
- it('should ', () => {
+ it('should', () => {
expect(
isDuplicationBlockInRemovedComponent([
{ _ref: '0', from: 2, size: 2 },
diff --git a/server/sonar-web/src/main/js/components/activity-graph/__tests__/utils-test.ts b/server/sonar-web/src/main/js/components/activity-graph/__tests__/utils-test.ts
index 06a3fd398f7..d7a342e1860 100644
--- a/server/sonar-web/src/main/js/components/activity-graph/__tests__/utils-test.ts
+++ b/server/sonar-web/src/main/js/components/activity-graph/__tests__/utils-test.ts
@@ -138,7 +138,7 @@ describe('hasHistoryData', () => {
]
}
])
- ).toBeTruthy();
+ ).toBe(true);
expect(
utils.hasHistoryData([
{
@@ -157,7 +157,7 @@ describe('hasHistoryData', () => {
]
}
])
- ).toBeTruthy();
+ ).toBe(true);
expect(
utils.hasHistoryData([
{
@@ -167,7 +167,7 @@ describe('hasHistoryData', () => {
data: [{ x: dates.parseDate('2017-04-27T08:21:32.000Z'), y: 2 }]
}
])
- ).toBeFalsy();
+ ).toBe(false);
});
});
diff --git a/server/sonar-web/src/main/js/components/controls/DateRangeInput.tsx b/server/sonar-web/src/main/js/components/controls/DateRangeInput.tsx
index 58d7d835597..36ccbe6cd37 100644
--- a/server/sonar-web/src/main/js/components/controls/DateRangeInput.tsx
+++ b/server/sonar-web/src/main/js/components/controls/DateRangeInput.tsx
@@ -55,7 +55,6 @@ export default class DateRangeInput extends React.PureComponent<Props> {
};
handleToChange = (to: Date | undefined) => {
- this.setState({ to });
this.props.onChange({ from: this.from, to });
};
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}
diff --git a/server/sonar-web/src/main/js/components/facet/__tests__/ListStyleFacet-test.tsx b/server/sonar-web/src/main/js/components/facet/__tests__/ListStyleFacet-test.tsx
index b0a8bfae528..3ad271764c4 100644
--- a/server/sonar-web/src/main/js/components/facet/__tests__/ListStyleFacet-test.tsx
+++ b/server/sonar-web/src/main/js/components/facet/__tests__/ListStyleFacet-test.tsx
@@ -214,7 +214,7 @@ function identity(str: string) {
function checkInitialState(wrapper: ShallowWrapper) {
expect(wrapper.state('query')).toBe('');
- expect(wrapper.state('searchResults')).toBe(undefined);
+ expect(wrapper.state('searchResults')).toBeUndefined();
expect(wrapper.state('searching')).toBe(false);
expect(wrapper.state('searchResultsCounts')).toEqual({});
expect(wrapper.state('showFullList')).toBe(false);
diff --git a/server/sonar-web/src/main/js/components/facet/__tests__/MultipleSelectionHint-test.tsx b/server/sonar-web/src/main/js/components/facet/__tests__/MultipleSelectionHint-test.tsx
index 768d13d90fb..e8794c85bfc 100644
--- a/server/sonar-web/src/main/js/components/facet/__tests__/MultipleSelectionHint-test.tsx
+++ b/server/sonar-web/src/main/js/components/facet/__tests__/MultipleSelectionHint-test.tsx
@@ -38,9 +38,9 @@ it('should render for windows', () => {
});
it('should not render when there is not selection', () => {
- expect(shallow(<MultipleSelectionHint options={3} values={0} />).type()).toBe(null);
+ expect(shallow(<MultipleSelectionHint options={3} values={0} />).type()).toBeNull();
});
it('should not render when there are not enough options', () => {
- expect(shallow(<MultipleSelectionHint options={1} values={1} />).type()).toBe(null);
+ expect(shallow(<MultipleSelectionHint options={1} values={1} />).type()).toBeNull();
});
diff --git a/server/sonar-web/src/main/js/components/hoc/__tests__/whenLoggedIn-test.tsx b/server/sonar-web/src/main/js/components/hoc/__tests__/whenLoggedIn-test.tsx
index e20ba928f55..7f5ccf8318e 100644
--- a/server/sonar-web/src/main/js/components/hoc/__tests__/whenLoggedIn-test.tsx
+++ b/server/sonar-web/src/main/js/components/hoc/__tests__/whenLoggedIn-test.tsx
@@ -41,7 +41,7 @@ it('should render for logged in user', () => {
it('should not render for anonymous user', () => {
const wrapper = shallowRender(false);
- expect(getRenderedType(wrapper)).toBe(null);
+ expect(getRenderedType(wrapper)).toBeNull();
expect(handleRequiredAuthentication).toBeCalled();
});