Skip to content

Commit

Permalink
Changed generateRowId to generateId, since that's more accurate
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-baillie-ortoo committed Mar 28, 2022
1 parent 9fa245e commit d29484d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import ObjectHelper from 'c/objectHelper';

describe( 'generateRowId', () => {
describe( 'generateId', () => {

it( 'returns an alpha numeric string that is 10 characters long', () => {

const got = ObjectHelper.generateRowId();
const got = ObjectHelper.generateId();
expect( got ).toHaveLength( 10 );
});

it( 'does not return the same string when called multiple times', () => {

let previousIds = [];
for ( let i=0; i<100; i++ ) {
const got = ObjectHelper.generateRowId();
const got = ObjectHelper.generateId();
expect( previousIds ).not.toContain( got );
previousIds.push( got );
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const generateRowId = function() {
const generateId = function() {
const length = 10;
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
const charactersLength = characters.length;
Expand Down

0 comments on commit d29484d

Please sign in to comment.