mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 09:41:57 +00:00
Remove common prefix from networks to increase color separation
This commit is contained in:
committed by
Simon Howe
parent
e95f46bfd8
commit
478a4a6d66
@@ -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('');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user