aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/components/hoc
diff options
context:
space:
mode:
authorPhilippe Perrin <philippe.perrin@sonarsource.com>2020-06-18 10:24:27 +0200
committersonartech <sonartech@sonarsource.com>2020-06-26 20:04:58 +0000
commit23d876af1e2b0750cc39bf8113501f303163acac (patch)
tree1b2f2de9b3000b0a3940af234b0c6718601853ee /server/sonar-web/src/main/js/components/hoc
parentdc2f7ec44a7b82709bf75eb81764a20912e3bbea (diff)
downloadsonarqube-23d876af1e2b0750cc39bf8113501f303163acac.tar.gz
sonarqube-23d876af1e2b0750cc39bf8113501f303163acac.zip
SONAR-13398 Display an additional message if some tasks are in error
Diffstat (limited to 'server/sonar-web/src/main/js/components/hoc')
-rw-r--r--server/sonar-web/src/main/js/components/hoc/__tests__/withIndexationContext-test.tsx8
-rw-r--r--server/sonar-web/src/main/js/components/hoc/__tests__/withIndexationGuard-test.tsx10
2 files changed, 14 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/components/hoc/__tests__/withIndexationContext-test.tsx b/server/sonar-web/src/main/js/components/hoc/__tests__/withIndexationContext-test.tsx
index d4ca9f9452f..3e2a264f5ad 100644
--- a/server/sonar-web/src/main/js/components/hoc/__tests__/withIndexationContext-test.tsx
+++ b/server/sonar-web/src/main/js/components/hoc/__tests__/withIndexationContext-test.tsx
@@ -26,7 +26,7 @@ import withIndexationContext, { WithIndexationContextProps } from '../withIndexa
it('should render correctly', () => {
const indexationContext: IndexationContextInterface = {
- status: { isCompleted: true, percentCompleted: 87 }
+ status: { isCompleted: true, percentCompleted: 87, hasFailures: false }
};
const wrapper = mountRender(indexationContext);
@@ -36,7 +36,11 @@ it('should render correctly', () => {
function mountRender(indexationContext?: Partial<IndexationContextInterface>) {
return mount(
- <IndexationContext.Provider value={{ status: { isCompleted: false }, ...indexationContext }}>
+ <IndexationContext.Provider
+ value={{
+ status: { isCompleted: false, percentCompleted: 23, hasFailures: false },
+ ...indexationContext
+ }}>
<TestComponentWithIndexationContext />
</IndexationContext.Provider>
);
diff --git a/server/sonar-web/src/main/js/components/hoc/__tests__/withIndexationGuard-test.tsx b/server/sonar-web/src/main/js/components/hoc/__tests__/withIndexationGuard-test.tsx
index fca47cf1b8d..c2f4a1bc42a 100644
--- a/server/sonar-web/src/main/js/components/hoc/__tests__/withIndexationGuard-test.tsx
+++ b/server/sonar-web/src/main/js/components/hoc/__tests__/withIndexationGuard-test.tsx
@@ -29,13 +29,19 @@ it('should render correctly', () => {
let wrapper = mountRender();
expect(wrapper.find(TestComponent).exists()).toBe(false);
- wrapper = mountRender({ status: { isCompleted: true } });
+ wrapper = mountRender({
+ status: { isCompleted: true, percentCompleted: 100, hasFailures: false }
+ });
expect(wrapper.find(TestComponent).exists()).toBe(true);
});
function mountRender(context?: Partial<IndexationContextInterface>) {
return mount(
- <IndexationContext.Provider value={{ status: { isCompleted: false }, ...context }}>
+ <IndexationContext.Provider
+ value={{
+ status: { isCompleted: false, percentCompleted: 23, hasFailures: false },
+ ...context
+ }}>
<TestComponentWithGuard />
</IndexationContext.Provider>
);