]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/not-available.pipe.spec.ts
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / pipes / not-available.pipe.spec.ts
index 14a6fd064ce8615160ea750c7efe6dbedb22268a..06279a5ea96e6cb21005e67365814941d3750f40 100644 (file)
@@ -1,32 +1,30 @@
-import { TestBed } from '@angular/core/testing';
-
-import { I18n } from '@ngx-translate/i18n-polyfill';
-
-import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper';
 import { NotAvailablePipe } from './not-available.pipe';
 
 describe('NotAvailablePipe', () => {
   let pipe: NotAvailablePipe;
 
-  configureTestBed({
-    providers: [i18nProviders]
-  });
-
   beforeEach(() => {
-    const i18n = TestBed.get(I18n);
-    pipe = new NotAvailablePipe(i18n);
+    pipe = new NotAvailablePipe();
   });
 
   it('create an instance', () => {
     expect(pipe).toBeTruthy();
   });
 
-  it('transforms not available', () => {
+  it('transforms not available (1)', () => {
     expect(pipe.transform('')).toBe('n/a');
   });
 
-  it('transforms number', () => {
+  it('transforms not available (2)', () => {
+    expect(pipe.transform('', 'Unknown')).toBe('Unknown');
+  });
+
+  it('transform not necessary (1)', () => {
     expect(pipe.transform(0)).toBe(0);
     expect(pipe.transform(1)).toBe(1);
   });
+
+  it('transform not necessary (2)', () => {
+    expect(pipe.transform('foo')).toBe('foo');
+  });
 });