diff options
Diffstat (limited to 'src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/ceph-short-version.pipe.spec.ts')
-rw-r--r-- | src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/ceph-short-version.pipe.spec.ts | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/ceph-short-version.pipe.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/ceph-short-version.pipe.spec.ts new file mode 100644 index 000000000..0242839df --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/ceph-short-version.pipe.spec.ts @@ -0,0 +1,21 @@ +import { CephShortVersionPipe } from './ceph-short-version.pipe'; + +describe('CephShortVersionPipe', () => { + const pipe = new CephShortVersionPipe(); + + it('create an instance', () => { + expect(pipe).toBeTruthy(); + }); + + it('transforms with correct version format', () => { + const value = + 'ceph version 13.1.0-534-g23d3751b89 \ + (23d3751b897b31d2bda57aeaf01acb5ff3c4a9cd) nautilus (dev)'; + expect(pipe.transform(value)).toBe('13.1.0-534-g23d3751b89'); + }); + + it('transforms with wrong version format', () => { + const value = 'foo'; + expect(pipe.transform(value)).toBe('foo'); + }); +}); |