Skip to content

Commit 91c2fa4

Browse files
committed
【ut】fix ut
1 parent be21b74 commit 91c2fa4

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

test/common/commontypes/UtilSpec.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -388,14 +388,16 @@ describe('Util', () => {
388388

389389
it('createUniqueID', () => {
390390
let id = Util.createUniqueID();
391-
expect(id).toBe('id_0');
392-
expect(Util.lastSeqID).toBe(0);
391+
let lastSeqId = Util.lastSeqID;
392+
expect(id).toContain('id_');
393+
expect(id).toBe(`id_${lastSeqId}`);
393394
id = Util.createUniqueID('custom_');
394-
expect(id).toBe('custom_1');
395-
expect(Util.lastSeqID).toBe(1);
395+
expect(id).toContain('custom_');
396+
expect(id).toBe(`custom_${lastSeqId + 1}`);
396397
id = Util.createUniqueID();
397-
expect(id).toBe('id_2');
398-
expect(Util.lastSeqID).toBe(2);
398+
expect(id).toContain('id_');
399+
expect(id).toBe(`id_${lastSeqId + 2}`);
400+
expect(lastSeqId + 2).toBe(Util.lastSeqID);
399401
})
400402

401403
});

0 commit comments

Comments
 (0)