Commit 776b502e authored by Alexander Turinske's avatar Alexander Turinske

Add test to document behavior of avatar_helper

- getIdenticonBackgroundClass behavior better documented
- remove changelog`
parent cdf88ad3
---
title: Update avatar helper to accept GraphQL id as well as database id
merge_request: 32261
author:
type: added
......@@ -27,6 +27,10 @@ describe('avatar_helper', () => {
expect(getIdenticonBackgroundClass('gid://gitlab/Project/1')).toEqual('bg2');
});
it('returns identicon bg class from unparsable string', () => {
expect(getIdenticonBackgroundClass('gid://gitlab/')).toEqual('bg1');
});
it(`wraps around if id is bigger than ${IDENTICON_BG_COUNT}`, () => {
expect(getIdenticonBackgroundClass(IDENTICON_BG_COUNT + 4)).toEqual('bg5');
expect(getIdenticonBackgroundClass(IDENTICON_BG_COUNT * 5 + 6)).toEqual('bg7');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment