Refresh hooks when refreshing extensions. (#14918)

This commit is contained in:
Tommaso Sciortino
2025-12-12 16:43:46 -08:00
committed by GitHub
parent 977248e095
commit 126c32aca4
9 changed files with 26 additions and 107 deletions

View File

@@ -127,10 +127,7 @@ describe('HookSystem Integration', () => {
'Hook system initialized successfully',
);
// Verify system is initialized
const status = hookSystem.getStatus();
expect(status.initialized).toBe(true);
// Note: totalHooks might be 0 if hook validation rejects the test hooks
expect(hookSystem.getAllHooks().length).toBe(1);
});
it('should not initialize twice', async () => {
@@ -204,12 +201,6 @@ describe('HookSystem Integration', () => {
});
expect(result.success).toBe(true);
});
it('should throw error when not initialized', () => {
expect(() => hookSystem.getEventHandler()).toThrow(
'Hook system not initialized',
);
});
});
describe('hook execution', () => {
@@ -261,24 +252,6 @@ describe('HookSystem Integration', () => {
});
});
describe('system management', () => {
it('should return correct status when initialized', async () => {
await hookSystem.initialize();
const status = hookSystem.getStatus();
expect(status.initialized).toBe(true);
// Note: totalHooks might be 0 if hook validation rejects the test hooks
expect(typeof status.totalHooks).toBe('number');
});
it('should return uninitialized status', () => {
const status = hookSystem.getStatus();
expect(status.initialized).toBe(false);
});
});
describe('hook disabling via settings', () => {
it('should not execute disabled hooks from settings', async () => {
// Create config with two hooks, one enabled and one disabled via settings