diff options
author | Philippe Perrin <philippe.perrin@sonarsource.com> | 2020-03-17 12:57:00 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2020-04-08 20:03:18 +0000 |
commit | 93cf9ba40b2b0769611b2036279879d9de546e01 (patch) | |
tree | 87851ab65349c8685d5b852fed749cb9d3c1ee0b /server/sonar-web/src/main/js/apps/projects | |
parent | 1079262251f6118a44a5209efdaab75f26086d33 (diff) | |
download | sonarqube-93cf9ba40b2b0769611b2036279879d9de546e01.tar.gz sonarqube-93cf9ba40b2b0769611b2036279879d9de546e01.zip |
Fix eslint's issues
Diffstat (limited to 'server/sonar-web/src/main/js/apps/projects')
6 files changed, 18 insertions, 18 deletions
diff --git a/server/sonar-web/src/main/js/apps/projects/components/__tests__/PageHeader-test.tsx b/server/sonar-web/src/main/js/apps/projects/components/__tests__/PageHeader-test.tsx index b8b174e2b24..292d6caff94 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/__tests__/PageHeader-test.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/__tests__/PageHeader-test.tsx @@ -34,7 +34,7 @@ it('should not render projects total', () => { shallowRender({ total: undefined }) .find('#projects-total') .exists() - ).toBeFalsy(); + ).toBe(false); }); it('should render disabled sorting options for visualizations', () => { diff --git a/server/sonar-web/src/main/js/apps/projects/components/__tests__/PageSidebar-test.tsx b/server/sonar-web/src/main/js/apps/projects/components/__tests__/PageSidebar-test.tsx index f00200dbf10..197b42b5ea9 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/__tests__/PageSidebar-test.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/__tests__/PageSidebar-test.tsx @@ -60,7 +60,7 @@ it('reset function should work correctly with view and visualizations', () => { visualization="bugs" /> ); - expect(sidebar.find('ClearAll').exists()).toBeFalsy(); + expect(sidebar.find('ClearAll').exists()).toBe(false); sidebar.setProps({ query: { size: '3' } }); - expect(sidebar.find('ClearAll').exists()).toBeTruthy(); + expect(sidebar.find('ClearAll').exists()).toBe(true); }); diff --git a/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectCard-test.tsx b/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectCard-test.tsx index dce3b87d09c..0fcbf20e45d 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectCard-test.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectCard-test.tsx @@ -45,14 +45,14 @@ const PROJECT: Project = { it('should show <ProjectCardOverall/> by default', () => { const wrapper = shallowRender(); - expect(wrapper.find('ProjectCardOverall')).toBeTruthy(); - expect(wrapper.find('ProjectCardLeak')).toBeTruthy(); + expect(wrapper.find('ProjectCardOverall').exists()).toBe(true); + expect(wrapper.find('ProjectCardLeak').exists()).toBe(false); }); it('should show <ProjectCardLeak/> when asked', () => { - const wrapper = shallowRender(); - expect(wrapper.find('ProjectCardLeak')).toBeTruthy(); - expect(wrapper.find('ProjectCardOverall')).toBeTruthy(); + const wrapper = shallowRender('leak'); + expect(wrapper.find('ProjectCardLeak').exists()).toBe(true); + expect(wrapper.find('ProjectCardOverall').exists()).toBe(false); }); function shallowRender(type?: string) { diff --git a/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectCardLeak-test.tsx b/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectCardLeak-test.tsx index 070c8594579..ee5e548d38f 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectCardLeak-test.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectCardLeak-test.tsx @@ -51,7 +51,7 @@ const USER_LOGGED_IN = mockLoggedInUser(); it('should display analysis date and leak start date', () => { const card = shallowRender(PROJECT); - expect(card.find('.project-card-dates').exists()).toBeTruthy(); + expect(card.find('.project-card-dates').exists()).toBe(true); expect(card.find('.project-card-dates').find('.project-card-leak-date')).toHaveLength(1); expect(card.find('.project-card-dates').find('DateTimeFormatter')).toHaveLength(1); }); @@ -59,7 +59,7 @@ it('should display analysis date and leak start date', () => { it('should not display analysis date or leak start date', () => { const project = { ...PROJECT, analysisDate: undefined }; const card = shallowRender(project); - expect(card.find('.project-card-dates').exists()).toBeFalsy(); + expect(card.find('.project-card-dates').exists()).toBe(false); }); it('should display tags', () => { @@ -68,7 +68,7 @@ it('should display tags', () => { shallowRender(project) .find('TagsList') .exists() - ).toBeTruthy(); + ).toBe(true); }); it('should display private badge', () => { @@ -77,7 +77,7 @@ it('should display private badge', () => { shallowRender(project) .find('Connect(PrivacyBadge)') .exists() - ).toBeTruthy(); + ).toBe(true); }); it('should display the leak measures and quality gate', () => { diff --git a/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectCardOverall-test.tsx b/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectCardOverall-test.tsx index 05515572ce2..369c72ba783 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectCardOverall-test.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectCardOverall-test.tsx @@ -48,12 +48,12 @@ it('should display analysis date (and not leak period) when defined', () => { shallowRender(PROJECT) .find('.project-card-dates') .exists() - ).toBeTruthy(); + ).toBe(true); expect( shallowRender({ ...PROJECT, analysisDate: undefined }) .find('.project-card-dates') .exists() - ).toBeFalsy(); + ).toBe(false); }); it('should not display the quality gate', () => { @@ -62,7 +62,7 @@ it('should not display the quality gate', () => { shallowRender(project) .find('ProjectCardOverallQualityGate') .exists() - ).toBeFalsy(); + ).toBe(false); }); it('should display tags', () => { @@ -71,7 +71,7 @@ it('should display tags', () => { shallowRender(project) .find('TagsList') .exists() - ).toBeTruthy(); + ).toBe(true); }); it('should display private badge', () => { @@ -80,7 +80,7 @@ it('should display private badge', () => { shallowRender(project) .find('Connect(PrivacyBadge)') .exists() - ).toBeTruthy(); + ).toBe(true); }); it('should display the overall measures and quality gate', () => { diff --git a/server/sonar-web/src/main/js/apps/projects/filters/__tests__/SearchableFilterFooter-test.tsx b/server/sonar-web/src/main/js/apps/projects/filters/__tests__/SearchableFilterFooter-test.tsx index e8378f6b1f8..42b173c2c7b 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/__tests__/SearchableFilterFooter-test.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/__tests__/SearchableFilterFooter-test.tsx @@ -39,7 +39,7 @@ it('should render items without the ones in the facet', () => { expect(wrapper.find('Select').prop('options')).toMatchSnapshot(); }); -it('should render items without the ones in the facet', () => { +it('should properly handle a change of the facet value', () => { const onQueryChange = jest.fn(); const wrapper = shallow( <SearchableFilterFooter |