]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/not-available.pipe.spec.ts
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / pipes / not-available.pipe.spec.ts
1 import { TestBed } from '@angular/core/testing';
2
3 import { I18n } from '@ngx-translate/i18n-polyfill';
4
5 import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper';
6 import { NotAvailablePipe } from './not-available.pipe';
7
8 describe('NotAvailablePipe', () => {
9 let pipe: NotAvailablePipe;
10
11 configureTestBed({
12 providers: [i18nProviders]
13 });
14
15 beforeEach(() => {
16 const i18n = TestBed.get(I18n);
17 pipe = new NotAvailablePipe(i18n);
18 });
19
20 it('create an instance', () => {
21 expect(pipe).toBeTruthy();
22 });
23
24 it('transforms not available', () => {
25 expect(pipe.transform('')).toBe('n/a');
26 });
27
28 it('transforms number', () => {
29 expect(pipe.transform(0)).toBe(0);
30 expect(pipe.transform(1)).toBe(1);
31 });
32 });