]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: Update prettier package
authorTiago Melo <tspmelo@gmail.com>
Thu, 18 Oct 2018 16:49:24 +0000 (17:49 +0100)
committerTiago Melo <tmelo@suse.com>
Tue, 6 Nov 2018 09:59:42 +0000 (09:59 +0000)
Signed-off-by: Tiago Melo <tmelo@suse.com>
17 files changed:
src/pybind/mgr/dashboard/frontend/package-lock.json
src/pybind/mgr/dashboard/frontend/package.json
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-purge-modal/rbd-trash-purge-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/breadcrumbs/breadcrumbs.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/auth.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/host.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/pool.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/tcmu-iscsi.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-validators.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/auth-guard.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/module-status-guard.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/notification.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/summary.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-manager.service.spec.ts
src/pybind/mgr/dashboard/frontend/tslint.json

index 6d7b8fcf8609c87e648bbf390a7e291d6d848fc1..80dcc14ea925fc5512d092e882b2cfb7e051a0ae 100644 (file)
       "dev": true
     },
     "prettier": {
-      "version": "1.14.0",
-      "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.14.0.tgz",
-      "integrity": "sha512-KtQ2EGaUwf2EyDfp1fxyEb0PqGKakVm0WyXwDt6u+cAoxbO2Z2CwKvOe3+b4+F2IlO9lYHi1kqFuRM70ddBnow==",
+      "version": "1.14.3",
+      "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.14.3.tgz",
+      "integrity": "sha512-qZDVnCrnpsRJJq5nSsiHCE3BYMED2OtsI+cmzIzF1QIfqm5ALf8tEJcO27zV1gKNKRPdhjO0dNWnrzssDQ1tFg==",
       "dev": true
     },
     "pretty-error": {
index 3e8a3fed45159ab1d90759e9461bf15a6c82ab6e..7f89063f7462290523d9e8ebd64dddaa41b28b74 100644 (file)
@@ -86,7 +86,7 @@
     "jest-canvas-mock": "1.1.0",
     "jest-preset-angular": "6.0.0",
     "jest-silent-reporter": "0.1.1",
-    "prettier": "1.14.0",
+    "prettier": "1.14.3",
     "protractor": "5.4.0",
     "ts-node": "7.0.0",
     "tslint": "5.11.0",
index 0ce979974c4bbc6511df6367591df982f9fae05c..c4ce343d4efdac29e6e0f5ff62c6b2174e12b9bc 100644 (file)
@@ -40,27 +40,24 @@ describe('RbdTrashPurgeModalComponent', () => {
     expect(component).toBeTruthy();
   });
 
-  it(
-    'should finish ngOnInit',
-    fakeAsync(() => {
-      component.poolPermission = new Permission(['read', 'create', 'update', 'delete']);
-      fixture.detectChanges();
-      const req = httpTesting.expectOne('api/pool?attrs=pool_name,application_metadata');
-      req.flush([
-        {
-          application_metadata: ['foo'],
-          pool_name: 'bar'
-        },
-        {
-          application_metadata: ['rbd'],
-          pool_name: 'baz'
-        }
-      ]);
-      tick();
-      expect(component.pools).toEqual(['baz']);
-      expect(component.purgeForm).toBeTruthy();
-    })
-  );
+  it('should finish ngOnInit', fakeAsync(() => {
+    component.poolPermission = new Permission(['read', 'create', 'update', 'delete']);
+    fixture.detectChanges();
+    const req = httpTesting.expectOne('api/pool?attrs=pool_name,application_metadata');
+    req.flush([
+      {
+        application_metadata: ['foo'],
+        pool_name: 'bar'
+      },
+      {
+        application_metadata: ['rbd'],
+        pool_name: 'baz'
+      }
+    ]);
+    tick();
+    expect(component.pools).toEqual(['baz']);
+    expect(component.purgeForm).toBeTruthy();
+  }));
 
   it('should call ngOnInit without pool permissions', () => {
     component.poolPermission = new Permission([]);
index 71723b5cbc7a2191ed422dc45d87aabbb4486378..dd8ec94d14e22b5b2274a57533e8af7036ff50c5 100644 (file)
@@ -125,15 +125,13 @@ describe('OsdListComponent', () => {
   });
 
   describe('test table actions in submenu', () => {
-    beforeEach(
-      fakeAsync(() => {
-        // The menu needs a click to render the dropdown!
-        const dropDownToggle = fixture.debugElement.query(By.css('.dropdown-toggle'));
-        dropDownToggle.triggerEventHandler('click', null);
-        tick();
-        fixture.detectChanges();
-      })
-    );
+    beforeEach(fakeAsync(() => {
+      // The menu needs a click to render the dropdown!
+      const dropDownToggle = fixture.debugElement.query(By.css('.dropdown-toggle'));
+      dropDownToggle.triggerEventHandler('click', null);
+      tick();
+      fixture.detectChanges();
+    }));
 
     /**
      * Helper function to retrieve menu item
index f6025a23e06960f4197a3736163c5c6fe262ac47..6a56c14bbfe29403c33b6cd8117072206b77f7b6 100644 (file)
@@ -126,22 +126,16 @@ describe('RgwUserFormComponent', () => {
       formHelper.expectErrorChange('user_id', '', 'required', true);
     });
 
-    it(
-      'should validate that username is valid',
-      fakeAsync(() => {
-        formHelper.setValue('user_id', 'ab', true);
-        tick(500);
-        formHelper.expectValid('user_id');
-      })
-    );
-
-    it(
-      'should validate that username is invalid',
-      fakeAsync(() => {
-        formHelper.setValue('user_id', 'abc', true);
-        tick(500);
-        formHelper.expectError('user_id', 'notUnique');
-      })
-    );
+    it('should validate that username is valid', fakeAsync(() => {
+      formHelper.setValue('user_id', 'ab', true);
+      tick(500);
+      formHelper.expectValid('user_id');
+    }));
+
+    it('should validate that username is invalid', fakeAsync(() => {
+      formHelper.setValue('user_id', 'abc', true);
+      tick(500);
+      formHelper.expectError('user_id', 'notUnique');
+    }));
   });
 });
index 9b7dac3f1b3af619381e51ff49f4b8f0049b58aa..bfc86a7766c60d224faae289141c44ff4e53767b 100644 (file)
@@ -64,69 +64,54 @@ describe('BreadcrumbsComponent', () => {
     expect(component.subscription).toBeDefined();
   });
 
-  it(
-    'should run postProcess and split the breadcrumbs when navigating to hosts',
-    fakeAsync(() => {
-      router.navigateByUrl('/hosts');
-      tick();
-      expect(component.crumbs).toEqual([
-        { path: null, text: 'Cluster' },
-        { path: '/hosts', text: 'Hosts' }
-      ]);
-    })
-  );
+  it('should run postProcess and split the breadcrumbs when navigating to hosts', fakeAsync(() => {
+    router.navigateByUrl('/hosts');
+    tick();
+    expect(component.crumbs).toEqual([
+      { path: null, text: 'Cluster' },
+      { path: '/hosts', text: 'Hosts' }
+    ]);
+  }));
 
-  it(
-    'should display empty breadcrumb when navigating to perf_counters from unknown path',
-    fakeAsync(() => {
-      router.navigateByUrl('/perf_counters');
-      tick();
-      expect(component.crumbs).toEqual([
-        { path: null, text: 'Cluster' },
-        { path: null, text: '' },
-        { path: '', text: 'Performance Counters' }
-      ]);
-    })
-  );
+  it('should display empty breadcrumb when navigating to perf_counters from unknown path', fakeAsync(() => {
+    router.navigateByUrl('/perf_counters');
+    tick();
+    expect(component.crumbs).toEqual([
+      { path: null, text: 'Cluster' },
+      { path: null, text: '' },
+      { path: '', text: 'Performance Counters' }
+    ]);
+  }));
 
-  it(
-    'should display Monitor breadcrumb when navigating to perf_counters from Monitors',
-    fakeAsync(() => {
-      router.navigate(['/perf_counters'], { queryParams: { fromLink: '/monitor' } });
-      tick();
-      expect(component.crumbs).toEqual([
-        { path: null, text: 'Cluster' },
-        { path: '/monitor', text: 'Monitors' },
-        { path: '', text: 'Performance Counters' }
-      ]);
-    })
-  );
+  it('should display Monitor breadcrumb when navigating to perf_counters from Monitors', fakeAsync(() => {
+    router.navigate(['/perf_counters'], { queryParams: { fromLink: '/monitor' } });
+    tick();
+    expect(component.crumbs).toEqual([
+      { path: null, text: 'Cluster' },
+      { path: '/monitor', text: 'Monitors' },
+      { path: '', text: 'Performance Counters' }
+    ]);
+  }));
 
-  it(
-    'should display Hosts breadcrumb when navigating to perf_counters from Hosts',
-    fakeAsync(() => {
-      router.navigate(['/perf_counters'], { queryParams: { fromLink: '/hosts' } });
-      tick();
-      expect(component.crumbs).toEqual([
-        { path: null, text: 'Cluster' },
-        { path: '/hosts', text: 'Hosts' },
-        { path: '', text: 'Performance Counters' }
-      ]);
-    })
-  );
+  it('should display Hosts breadcrumb when navigating to perf_counters from Hosts', fakeAsync(() => {
+    router.navigate(['/perf_counters'], { queryParams: { fromLink: '/hosts' } });
+    tick();
+    expect(component.crumbs).toEqual([
+      { path: null, text: 'Cluster' },
+      { path: '/hosts', text: 'Hosts' },
+      { path: '', text: 'Performance Counters' }
+    ]);
+  }));
 
-  it(
-    'should show all 3 breadcrumbs when navigating to RBD Add',
-    fakeAsync(() => {
-      router.navigateByUrl('/block/rbd/add');
-      tick();
-      expect(component.crumbs).toEqual([
-        { path: null, text: 'Block' },
-        { path: '/block/rbd', text: 'Images' },
-        { path: '/block/rbd/add', text: 'Add' }
-      ]);
-    })
-  );
+  it('should show all 3 breadcrumbs when navigating to RBD Add', fakeAsync(() => {
+    router.navigateByUrl('/block/rbd/add');
+    tick();
+    expect(component.crumbs).toEqual([
+      { path: null, text: 'Block' },
+      { path: '/block/rbd', text: 'Images' },
+      { path: '/block/rbd/add', text: 'Add' }
+    ]);
+  }));
 
   it('should unsubscribe on ngOnDestroy', () => {
     expect(component.subscription.closed).toBeFalsy();
index fd2d9d8f57b3f6582b16b91e0bcb4eeff9ea7597..6c0ecefeb8dd31b4ee1eaf1d1394dd659a0c433c 100644 (file)
@@ -28,31 +28,25 @@ describe('AuthService', () => {
     expect(service).toBeTruthy();
   });
 
-  it(
-    'should login and save the user',
-    fakeAsync(() => {
-      const fakeCredentials = { username: 'foo', password: 'bar' };
-      const fakeResponse = { username: 'foo', token: 'tokenbytes' };
-      service.login(<any>fakeCredentials);
-      const req = httpTesting.expectOne('api/auth');
-      expect(req.request.method).toBe('POST');
-      expect(req.request.body).toEqual(fakeCredentials);
-      req.flush(fakeResponse);
-      tick();
-      expect(localStorage.getItem('dashboard_username')).toBe('foo');
-      expect(localStorage.getItem('access_token')).toBe('tokenbytes');
-    })
-  );
-
-  it(
-    'should logout and remove the user',
-    fakeAsync(() => {
-      service.logout();
-      const req = httpTesting.expectOne('api/auth');
-      expect(req.request.method).toBe('DELETE');
-      req.flush({ username: 'foo' });
-      tick();
-      expect(localStorage.getItem('dashboard_username')).toBe(null);
-    })
-  );
+  it('should login and save the user', fakeAsync(() => {
+    const fakeCredentials = { username: 'foo', password: 'bar' };
+    const fakeResponse = { username: 'foo', token: 'tokenbytes' };
+    service.login(<any>fakeCredentials);
+    const req = httpTesting.expectOne('api/auth');
+    expect(req.request.method).toBe('POST');
+    expect(req.request.body).toEqual(fakeCredentials);
+    req.flush(fakeResponse);
+    tick();
+    expect(localStorage.getItem('dashboard_username')).toBe('foo');
+    expect(localStorage.getItem('access_token')).toBe('tokenbytes');
+  }));
+
+  it('should logout and remove the user', fakeAsync(() => {
+    service.logout();
+    const req = httpTesting.expectOne('api/auth');
+    expect(req.request.method).toBe('DELETE');
+    req.flush({ username: 'foo' });
+    tick();
+    expect(localStorage.getItem('dashboard_username')).toBe(null);
+  }));
 });
index d283ef7c0fe4e4ae0f409a6dbfb6461b6926e238..a9354ce54f7b022d7a0f738bc0b7d4bb853fa203 100644 (file)
@@ -26,16 +26,13 @@ describe('HostService', () => {
     expect(service).toBeTruthy();
   });
 
-  it(
-    'should call list',
-    fakeAsync(() => {
-      let result;
-      service.list().then((resp) => (result = resp));
-      const req = httpTesting.expectOne('api/host');
-      expect(req.request.method).toBe('GET');
-      req.flush(['foo', 'bar']);
-      tick();
-      expect(result).toEqual(['foo', 'bar']);
-    })
-  );
+  it('should call list', fakeAsync(() => {
+    let result;
+    service.list().then((resp) => (result = resp));
+    const req = httpTesting.expectOne('api/host');
+    expect(req.request.method).toBe('GET');
+    req.flush(['foo', 'bar']);
+    tick();
+    expect(result).toEqual(['foo', 'bar']);
+  }));
 });
index afa5abff2cd6f5ebea3da4ebcdaf9c789f0c5b70..e7cf7f1e5a676f44434b080c84fc8e6b3f8b5da0 100644 (file)
@@ -60,29 +60,23 @@ describe('PoolService', () => {
     expect(req.request.method).toBe('DELETE');
   });
 
-  it(
-    'should call list without parameter',
-    fakeAsync(() => {
-      let result;
-      service.list().then((resp) => (result = resp));
-      const req = httpTesting.expectOne(`${apiPath}?attrs=`);
-      expect(req.request.method).toBe('GET');
-      req.flush(['foo', 'bar']);
-      tick();
-      expect(result).toEqual(['foo', 'bar']);
-    })
-  );
+  it('should call list without parameter', fakeAsync(() => {
+    let result;
+    service.list().then((resp) => (result = resp));
+    const req = httpTesting.expectOne(`${apiPath}?attrs=`);
+    expect(req.request.method).toBe('GET');
+    req.flush(['foo', 'bar']);
+    tick();
+    expect(result).toEqual(['foo', 'bar']);
+  }));
 
-  it(
-    'should call list with a list',
-    fakeAsync(() => {
-      let result;
-      service.list(['foo']).then((resp) => (result = resp));
-      const req = httpTesting.expectOne(`${apiPath}?attrs=foo`);
-      expect(req.request.method).toBe('GET');
-      req.flush(['foo', 'bar']);
-      tick();
-      expect(result).toEqual(['foo', 'bar']);
-    })
-  );
+  it('should call list with a list', fakeAsync(() => {
+    let result;
+    service.list(['foo']).then((resp) => (result = resp));
+    const req = httpTesting.expectOne(`${apiPath}?attrs=foo`);
+    expect(req.request.method).toBe('GET');
+    req.flush(['foo', 'bar']);
+    tick();
+    expect(result).toEqual(['foo', 'bar']);
+  }));
 });
index 2792a801073954c4d2a829fb5e847bbcb4442d27..99cd424215d7c0279a441196f79f73011fc45648 100644 (file)
@@ -26,18 +26,15 @@ describe('TcmuIscsiService', () => {
     expect(service).toBeTruthy();
   });
 
-  it(
-    'should call tcmuiscsi',
-    fakeAsync(() => {
-      let result;
-      service.tcmuiscsi().subscribe((resp) => {
-        result = resp;
-      });
-      const req = httpTesting.expectOne('api/tcmuiscsi');
-      expect(req.request.method).toBe('GET');
-      req.flush(['foo']);
-      tick();
-      expect(result).toEqual(['foo']);
-    })
-  );
+  it('should call tcmuiscsi', fakeAsync(() => {
+    let result;
+    service.tcmuiscsi().subscribe((resp) => {
+      result = resp;
+    });
+    const req = httpTesting.expectOne('api/tcmuiscsi');
+    expect(req.request.method).toBe('GET');
+    req.flush(['foo']);
+    tick();
+    expect(result).toEqual(['foo']);
+  }));
 });
index f0e54cd4c06afa36bee70a930d2d109c433e3684..fdc5428921d2b35570be16d481ec34384b5e1329 100644 (file)
@@ -435,22 +435,16 @@ describe('CdValidators', () => {
       expectValid('');
     });
 
-    it(
-      'should not error because of not existing input',
-      fakeAsync(() => {
-        formHelper.setValue('x', 'abc', true);
-        tick(500);
-        formHelper.expectValid('x');
-      })
-    );
-
-    it(
-      'should error because of already existing input',
-      fakeAsync(() => {
-        formHelper.setValue('x', 'xyz', true);
-        tick(500);
-        formHelper.expectError('x', 'notUnique');
-      })
-    );
+    it('should not error because of not existing input', fakeAsync(() => {
+      formHelper.setValue('x', 'abc', true);
+      tick(500);
+      formHelper.expectValid('x');
+    }));
+
+    it('should error because of already existing input', fakeAsync(() => {
+      formHelper.setValue('x', 'xyz', true);
+      tick(500);
+      formHelper.expectError('x', 'notUnique');
+    }));
   });
 });
index b876228df22b5838747eb778a09913b3cd68249c..ff1012191122db4b62267de1a2d79be9b4c85ea8 100644 (file)
@@ -36,13 +36,10 @@ describe('AuthGuardService', () => {
     expect(service.canActivate(null, null)).toBe(true);
   });
 
-  it(
-    'should prevent user if not loggedIn and redirect to login page',
-    fakeAsync(() => {
-      const router = TestBed.get(Router);
-      expect(service.canActivate(null, null)).toBe(false);
-      tick();
-      expect(router.url).toBe('/login');
-    })
-  );
+  it('should prevent user if not loggedIn and redirect to login page', fakeAsync(() => {
+    const router = TestBed.get(Router);
+    expect(service.canActivate(null, null)).toBe(false);
+    tick();
+    expect(router.url).toBe('/login');
+  }));
 });
index c6fc4f84abcbc11e05d2adb2800915ba4755d3fd..a4d5eb8f4118ab9122331225bd320257ed7a8f72 100644 (file)
@@ -62,25 +62,16 @@ describe('ModuleStatusGuardService', () => {
     expect(service).toBeTruthy();
   });
 
-  it(
-    'should test canActivate with status available',
-    fakeAsync(() => {
-      route.data.moduleStatusGuardConfig.redirectTo = 'foo';
-      testCanActivate({ available: true, message: 'foo' }, true, '/');
-    })
-  );
+  it('should test canActivate with status available', fakeAsync(() => {
+    route.data.moduleStatusGuardConfig.redirectTo = 'foo';
+    testCanActivate({ available: true, message: 'foo' }, true, '/');
+  }));
 
-  it(
-    'should test canActivateChild with status unavailable',
-    fakeAsync(() => {
-      testCanActivate({ available: false, message: null }, false, '/foo/');
-    })
-  );
+  it('should test canActivateChild with status unavailable', fakeAsync(() => {
+    testCanActivate({ available: false, message: null }, false, '/foo/');
+  }));
 
-  it(
-    'should test canActivateChild with status unavailable',
-    fakeAsync(() => {
-      testCanActivate(null, false, '/foo');
-    })
-  );
+  it('should test canActivateChild with status unavailable', fakeAsync(() => {
+    testCanActivate(null, false, '/foo');
+  }));
 });
index 204a9e1c5379ed8d7432eeb4acc3b98617c6916b..56a2bad89f647ab89c011609a1c57b22374949b7 100644 (file)
@@ -39,110 +39,86 @@ describe('NotificationService', () => {
     expect(notificationService['dataSource'].getValue()).toEqual([]);
   });
 
-  it(
-    'should read old notifications',
-    fakeAsync(() => {
-      localStorage.setItem(
-        'cdNotifications',
-        '[{"type":2,"message":"foobar","timestamp":"2018-05-24T09:41:32.726Z"}]'
-      );
-      const service = new NotificationService(null, null);
-      expect(service['dataSource'].getValue().length).toBe(1);
-    })
-  );
+  it('should read old notifications', fakeAsync(() => {
+    localStorage.setItem(
+      'cdNotifications',
+      '[{"type":2,"message":"foobar","timestamp":"2018-05-24T09:41:32.726Z"}]'
+    );
+    const service = new NotificationService(null, null);
+    expect(service['dataSource'].getValue().length).toBe(1);
+  }));
 
-  it(
-    'should cancel a notification',
-    fakeAsync(() => {
-      const timeoutId = notificationService.show(NotificationType.error, 'Simple test');
-      notificationService.cancel(timeoutId);
-      tick(5000);
-      expect(notificationService['dataSource'].getValue().length).toBe(0);
-    })
-  );
+  it('should cancel a notification', fakeAsync(() => {
+    const timeoutId = notificationService.show(NotificationType.error, 'Simple test');
+    notificationService.cancel(timeoutId);
+    tick(5000);
+    expect(notificationService['dataSource'].getValue().length).toBe(0);
+  }));
 
-  it(
-    'should create a success notification and save it',
-    fakeAsync(() => {
-      notificationService.show(NotificationType.success, 'Simple test');
-      tick(100);
-      expect(notificationService['dataSource'].getValue().length).toBe(1);
-      expect(notificationService['dataSource'].getValue()[0].type).toBe(NotificationType.success);
-    })
-  );
+  it('should create a success notification and save it', fakeAsync(() => {
+    notificationService.show(NotificationType.success, 'Simple test');
+    tick(100);
+    expect(notificationService['dataSource'].getValue().length).toBe(1);
+    expect(notificationService['dataSource'].getValue()[0].type).toBe(NotificationType.success);
+  }));
 
-  it(
-    'should create an error notification and save it',
-    fakeAsync(() => {
-      notificationService.show(NotificationType.error, 'Simple test');
-      tick(100);
-      expect(notificationService['dataSource'].getValue().length).toBe(1);
-      expect(notificationService['dataSource'].getValue()[0].type).toBe(NotificationType.error);
-    })
-  );
+  it('should create an error notification and save it', fakeAsync(() => {
+    notificationService.show(NotificationType.error, 'Simple test');
+    tick(100);
+    expect(notificationService['dataSource'].getValue().length).toBe(1);
+    expect(notificationService['dataSource'].getValue()[0].type).toBe(NotificationType.error);
+  }));
 
-  it(
-    'should create an info notification and save it',
-    fakeAsync(() => {
+  it('should create an info notification and save it', fakeAsync(() => {
+    notificationService.show(NotificationType.info, 'Simple test');
+    tick(100);
+    expect(notificationService['dataSource'].getValue().length).toBe(1);
+    const notification = notificationService['dataSource'].getValue()[0];
+    expect(notification.type).toBe(NotificationType.info);
+    expect(notification.title).toBe('Simple test');
+    expect(notification.message).toBe(undefined);
+  }));
+
+  it('should never have more then 10 notifications', fakeAsync(() => {
+    for (let index = 0; index < 15; index++) {
       notificationService.show(NotificationType.info, 'Simple test');
       tick(100);
-      expect(notificationService['dataSource'].getValue().length).toBe(1);
-      const notification = notificationService['dataSource'].getValue()[0];
-      expect(notification.type).toBe(NotificationType.info);
-      expect(notification.title).toBe('Simple test');
-      expect(notification.message).toBe(undefined);
-    })
-  );
-
-  it(
-    'should never have more then 10 notifications',
-    fakeAsync(() => {
-      for (let index = 0; index < 15; index++) {
-        notificationService.show(NotificationType.info, 'Simple test');
-        tick(100);
-      }
-      expect(notificationService['dataSource'].getValue().length).toBe(10);
-    })
-  );
+    }
+    expect(notificationService['dataSource'].getValue().length).toBe(10);
+  }));
 
-  it(
-    'should show a success task notification',
-    fakeAsync(() => {
-      const task = _.assign(new FinishedTask(), {
-        success: true
-      });
-      notificationService.notifyTask(task, true);
-      tick(100);
-      expect(notificationService['dataSource'].getValue().length).toBe(1);
-      const notification = notificationService['dataSource'].getValue()[0];
-      expect(notification.type).toBe(NotificationType.success);
-      expect(notification.title).toBe('Executed unknown task');
-      expect(notification.message).toBe(undefined);
-    })
-  );
+  it('should show a success task notification', fakeAsync(() => {
+    const task = _.assign(new FinishedTask(), {
+      success: true
+    });
+    notificationService.notifyTask(task, true);
+    tick(100);
+    expect(notificationService['dataSource'].getValue().length).toBe(1);
+    const notification = notificationService['dataSource'].getValue()[0];
+    expect(notification.type).toBe(NotificationType.success);
+    expect(notification.title).toBe('Executed unknown task');
+    expect(notification.message).toBe(undefined);
+  }));
 
-  it(
-    'should show a error task notification',
-    fakeAsync(() => {
-      const task = _.assign(
-        new FinishedTask('rbd/create', {
-          pool_name: 'somePool',
-          image_name: 'someImage'
-        }),
-        {
-          success: false,
-          exception: {
-            code: 17
-          }
+  it('should show a error task notification', fakeAsync(() => {
+    const task = _.assign(
+      new FinishedTask('rbd/create', {
+        pool_name: 'somePool',
+        image_name: 'someImage'
+      }),
+      {
+        success: false,
+        exception: {
+          code: 17
         }
-      );
-      notificationService.notifyTask(task);
-      tick(100);
-      expect(notificationService['dataSource'].getValue().length).toBe(1);
-      const notification = notificationService['dataSource'].getValue()[0];
-      expect(notification.type).toBe(NotificationType.error);
-      expect(notification.title).toBe(`Failed to create RBD 'somePool/someImage'`);
-      expect(notification.message).toBe(`Name is already used by RBD 'somePool/someImage'.`);
-    })
-  );
+      }
+    );
+    notificationService.notifyTask(task);
+    tick(100);
+    expect(notificationService['dataSource'].getValue().length).toBe(1);
+    const notification = notificationService['dataSource'].getValue()[0];
+    expect(notification.type).toBe(NotificationType.error);
+    expect(notification.title).toBe(`Failed to create RBD 'somePool/someImage'`);
+    expect(notification.message).toBe(`Name is already used by RBD 'somePool/someImage'.`);
+  }));
 });
index 4dd03110c13ff11c7d68eb233d68cc2f7160fa0e..4fbf3a558bc5ca84f0df64cbd5fed46ea3eeafed 100644 (file)
@@ -46,21 +46,18 @@ describe('SummaryService', () => {
     expect(summaryService).toBeTruthy();
   });
 
-  it(
-    'should call refresh',
-    fakeAsync(() => {
-      authStorageService.set('foobar');
-      let result = false;
-      summaryService.refresh();
-      summaryService.subscribe(() => {
-        result = true;
-      });
-      tick(5000);
-      spyOn(summaryService, 'refresh').and.callFake(() => true);
-      tick(5000);
-      expect(result).toEqual(true);
-    })
-  );
+  it('should call refresh', fakeAsync(() => {
+    authStorageService.set('foobar');
+    let result = false;
+    summaryService.refresh();
+    summaryService.subscribe(() => {
+      result = true;
+    });
+    tick(5000);
+    spyOn(summaryService, 'refresh').and.callFake(() => true);
+    tick(5000);
+    expect(result).toEqual(true);
+  }));
 
   describe('Should test methods after first refresh', () => {
     beforeEach(() => {
index 7fbddbfdd65ba5a3936ad34a539554bc14ef89b4..1fab5d39e3cd9d078641872398acee555e221e87 100644 (file)
@@ -53,28 +53,22 @@ describe('TaskManagerService', () => {
     expect(taskManagerService).toBeTruthy();
   });
 
-  it(
-    'should subscribe and be notified when task is finished',
-    fakeAsync(() => {
-      expect(taskManagerService.subscriptions.length).toBe(1);
-      summaryService.refresh();
-      tick();
-      expect(called).toEqual(true);
-      expect(taskManagerService.subscriptions).toEqual([]);
-    })
-  );
+  it('should subscribe and be notified when task is finished', fakeAsync(() => {
+    expect(taskManagerService.subscriptions.length).toBe(1);
+    summaryService.refresh();
+    tick();
+    expect(called).toEqual(true);
+    expect(taskManagerService.subscriptions).toEqual([]);
+  }));
 
-  it(
-    'should subscribe and process executing taks',
-    fakeAsync(() => {
-      const original_subscriptions = _.cloneDeep(taskManagerService.subscriptions);
-      _.assign(summary, {
-        executing_tasks: [{ name: 'foo', metadata: {} }],
-        finished_tasks: []
-      });
-      summaryService.refresh();
-      tick();
-      expect(taskManagerService.subscriptions).toEqual(original_subscriptions);
-    })
-  );
+  it('should subscribe and process executing taks', fakeAsync(() => {
+    const original_subscriptions = _.cloneDeep(taskManagerService.subscriptions);
+    _.assign(summary, {
+      executing_tasks: [{ name: 'foo', metadata: {} }],
+      finished_tasks: []
+    });
+    summaryService.refresh();
+    tick();
+    expect(taskManagerService.subscriptions).toEqual(original_subscriptions);
+  }));
 });
index 2163bd977efc027125695d6a1aeae1800abe73f5..e4c09adcb8129fcf5c3818c0256903e75025c9d3 100644 (file)
@@ -14,7 +14,6 @@
     "indent": [true, "spaces"],
     "interface-over-type-literal": true,
     "label-position": true,
-    "max-line-length": [true, { "limit": 100, "ignore-pattern": "^import |^export {(.*?)}" }],
     "member-access": false,
     "member-ordering": [
       true,