]> git.proxmox.com Git - ceph.git/blame - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/ceph-release-name.pipe.spec.ts
import ceph quincy 17.2.4
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / pipes / ceph-release-name.pipe.spec.ts
CommitLineData
11fdf7f2
TL
1import { CephReleaseNamePipe } from './ceph-release-name.pipe';
2
3describe('CephReleaseNamePipe', () => {
4 const pipe = new CephReleaseNamePipe();
5
6 it('create an instance', () => {
7 expect(pipe).toBeTruthy();
8 });
9
10 it('recognizes a stable release', () => {
11 const value =
12 'ceph version 13.2.1 \
13 (5533ecdc0fda920179d7ad84e0aa65a127b20d77) mimic (stable)';
14 expect(pipe.transform(value)).toBe('mimic');
15 });
16
2a845540 17 it('recognizes a development release as the main branch', () => {
11fdf7f2
TL
18 const value =
19 'ceph version 13.1.0-534-g23d3751b89 \
20 (23d3751b897b31d2bda57aeaf01acb5ff3c4a9cd) nautilus (dev)';
2a845540 21 expect(pipe.transform(value)).toBe('main');
11fdf7f2
TL
22 });
23
24 it('transforms with wrong version format', () => {
25 const value = 'foo';
26 expect(pipe.transform(value)).toBe('foo');
27 });
28});