2024-06-07 04:13:31 -07:00
|
|
|
import { InternalHooks } from '@/InternalHooks';
|
|
|
|
import { License } from '@/License';
|
|
|
|
import { LoadNodesAndCredentials } from '@/LoadNodesAndCredentials';
|
|
|
|
import { ClearLicenseCommand } from '@/commands/license/clear';
|
|
|
|
|
2024-06-18 01:50:39 -07:00
|
|
|
import { setupTestCommand } from '@test-integration/utils/testCommand';
|
|
|
|
import { mockInstance } from '../../shared/mocking';
|
2024-06-07 04:13:31 -07:00
|
|
|
|
2024-06-18 01:50:39 -07:00
|
|
|
mockInstance(InternalHooks);
|
|
|
|
mockInstance(LoadNodesAndCredentials);
|
|
|
|
const license = mockInstance(License);
|
|
|
|
const command = setupTestCommand(ClearLicenseCommand);
|
2024-06-07 04:13:31 -07:00
|
|
|
|
|
|
|
test('license:clear invokes shutdown() to release any floating entitlements', async () => {
|
2024-06-18 01:50:39 -07:00
|
|
|
await command.run();
|
2024-06-07 04:13:31 -07:00
|
|
|
|
|
|
|
expect(license.init).toHaveBeenCalledTimes(1);
|
|
|
|
expect(license.shutdown).toHaveBeenCalledTimes(1);
|
|
|
|
});
|