2024-08-22 02:10:37 -07:00
|
|
|
import { License } from '@/license';
|
|
|
|
import { LoadNodesAndCredentials } from '@/load-nodes-and-credentials';
|
2024-06-07 04:13:31 -07:00
|
|
|
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(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);
|
|
|
|
});
|