Additional tests (need to expand more...) (#1172)

* Additional utility tests

* Args on constructor
This commit is contained in:
Jaco
2021-11-11 15:20:01 +02:00
committed by GitHub
parent 313b44388a
commit 9e1e49a1b8
7 changed files with 94 additions and 6 deletions
+12
View File
@@ -21,4 +21,16 @@ describe('stringShorten', (): void => {
stringShorten(String('0123456789'), 3)
).toEqual('012…789');
});
it('returns the value as-is when <= maxLength (defaults)', (): void => {
expect(
stringShorten('012345', 4)
).toEqual('012345');
});
it('returns the shortened value when > maxLength (defaults)', (): void => {
expect(
stringShorten('01234567890123456789')
).toEqual('012345…456789');
});
});