summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/path.pipe.spec.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/path.pipe.spec.ts')
-rw-r--r--src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/path.pipe.spec.ts18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/path.pipe.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/path.pipe.spec.ts
new file mode 100644
index 000000000..49375f8c6
--- /dev/null
+++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/path.pipe.spec.ts
@@ -0,0 +1,18 @@
+import { PathPipe } from './path.pipe';
+
+describe('PathPipe', () => {
+ it('create an instance', () => {
+ const pipe = new PathPipe();
+ expect(pipe).toBeTruthy();
+ });
+
+ it('should transform the path', () => {
+ const pipe = new PathPipe();
+ expect(pipe.transform('/a/b/c/d')).toBe('/a/.../d');
+ });
+
+ it('should transform the path with no slash at beginning', () => {
+ const pipe = new PathPipe();
+ expect(pipe.transform('a/b/c/d')).toBe('a/.../d');
+ });
+});