Remove common prefix from networks to increase color separation

This commit is contained in:
David Kaltschmidt
2016-05-25 11:26:31 +02:00
committed by Simon Howe
parent e95f46bfd8
commit 478a4a6d66
5 changed files with 33 additions and 2 deletions

View File

@@ -10,4 +10,15 @@ describe('StringUtils', () => {
expect(formatMetric(0)).toBe('0.00');
});
});
describe('longestCommonPrefix', () => {
const fun = StringUtils.longestCommonPrefix;
it('it should return the longest common prefix', () => {
expect(fun(['interspecies', 'interstellar'])).toBe('inters');
expect(fun(['space', 'space'])).toBe('space');
expect(fun([''])).toBe('');
expect(fun(['prefix', 'suffix'])).toBe('');
});
});
});