test: Add tests for license manager reinit method (#9471)

This commit is contained in:
Omar Ajoue 2024-05-22 10:26:49 +01:00 committed by GitHub
parent ffe034c72e
commit c1eef60ccd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -252,4 +252,20 @@ describe('License', () => {
});
});
});
describe('reinit', () => {
it('should reinitialize license manager', async () => {
const license = new License(mock(), mock(), mock(), mock(), mock());
await license.init();
const initSpy = jest.spyOn(license, 'init');
await license.reinit();
expect(initSpy).toHaveBeenCalledWith('main', true);
expect(LicenseManager.prototype.reset).toHaveBeenCalled();
expect(LicenseManager.prototype.initialize).toHaveBeenCalled();
});
});
});