Use _.uniqueId() instead of Math.random() for dummy badges

This commit is contained in:
Winnie Hellmann 2018-08-23 20:01:12 +02:00
parent a78c443de2
commit b4dc978d01
1 changed files with 2 additions and 1 deletions

View File

@ -1,8 +1,9 @@
import _ from 'underscore';
import { PROJECT_BADGE } from '~/badges/constants';
import { DUMMY_IMAGE_URL, TEST_HOST } from 'spec/test_constants';
export const createDummyBadge = () => {
const id = Math.floor(1000 * Math.random());
const id = _.uniqueId();
return {
id,
imageUrl: `${TEST_HOST}/badges/${id}/image/url`,