Skip to content

Commit 1196193

Browse files
test: add coverage to VUID
1 parent be04392 commit 1196193

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/vuidManager.spec.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,25 @@ describe('VuidManager', () => {
9999
verify(mockCache.set(anyString(), anything())).once();
100100
expect(VuidManager.isVuid(manager.vuid)).toBe(true);
101101
});
102+
103+
it('should call remove when enableVuid is not specified', async () => {
104+
const manager = await VuidManager.instance(instance(mockCache));
105+
106+
verify(mockCache.remove(anyString())).once();
107+
expect(manager.vuid).toBe('');
108+
});
109+
110+
it('should call remove when enableVuid is false', async () => {
111+
const manager = await VuidManager.instance(instance(mockCache), {enableVuid: false});
112+
113+
verify(mockCache.remove(anyString())).once();
114+
expect(manager.vuid).toBe('');
115+
});
116+
117+
it('should never call remove when enableVuid is true', async () => {
118+
const manager = await VuidManager.instance(instance(mockCache), {enableVuid: true});
119+
120+
verify(mockCache.remove(anyString())).never();
121+
expect(VuidManager.isVuid(manager.vuid)).toBe(true);
122+
});
102123
});

0 commit comments

Comments
 (0)