Skip to content

Commit 63d7045

Browse files
dannyshmueliclaude
andcommitted
Remove push-up challenge tests from test suite
- Remove Push-Up Challenge test block from api-client.test.ts - Remove installChallengeStatusLineFeature and removeChallengeStatusLineFeature tests from claude-settings-manager.test.ts - Remove PUSHUP_ONLY state test from detector.test.ts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent c8483ef commit 63d7045

File tree

3 files changed

+0
-155
lines changed

3 files changed

+0
-155
lines changed

tests/unit/lib/api-client.test.ts

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -388,41 +388,6 @@ describe('API Client Module', () => {
388388
});
389389
});
390390

391-
describe('Push-Up Challenge', () => {
392-
it('should sync push-up challenge data', async () => {
393-
const pushUpData = {
394-
date: '2024-01-15',
395-
count: 50,
396-
sets: [10, 10, 10, 10, 10],
397-
};
398-
399-
mockAxiosInstance.post.mockResolvedValue({
400-
data: { success: true, totalToday: 50 },
401-
});
402-
403-
const result = await apiClient.syncPushUpChallenge(pushUpData);
404-
405-
expect(result).toEqual({ success: true, totalToday: 50 });
406-
expect(mockAxiosInstance.post).toHaveBeenCalledWith('/api/push-up-challenge/sync', pushUpData);
407-
});
408-
409-
it('should fetch push-up challenge stats', async () => {
410-
const mockStats = {
411-
totalPushUps: 1500,
412-
currentStreak: 7,
413-
longestStreak: 14,
414-
averagePerDay: 50,
415-
};
416-
417-
mockAxiosInstance.get.mockResolvedValue({ data: mockStats });
418-
419-
const result = await apiClient.fetchPushUpChallengeStats();
420-
421-
expect(result).toEqual(mockStats);
422-
expect(mockAxiosInstance.get).toHaveBeenCalledWith('/api/push-up-challenge/stats');
423-
});
424-
});
425-
426391
describe('Upload Error Handling', () => {
427392
it('should propagate upload errors', async () => {
428393
const sessions = [testData.createSession()];

tests/unit/lib/claude-settings-manager.test.ts

Lines changed: 0 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -423,104 +423,4 @@ describe('ClaudeSettingsManager', () => {
423423
});
424424
});
425425

426-
describe('installChallengeStatusLineFeature', () => {
427-
it('should install challenge status line with refresh hook', async () => {
428-
const mockSettings = { hooks: {} };
429-
mockSettingsReader.readGlobalSettings.mockResolvedValue(mockSettings);
430-
431-
await manager.installChallengeStatusLineFeature();
432-
433-
const savedSettings = mockSettingsReader.writeGlobalSettings.mock.calls[0][0];
434-
// Should have statusLine config for challenge
435-
expect(savedSettings.statusLine).toBeDefined();
436-
expect(savedSettings.statusLine?.command).toContain('statusline-challenge');
437-
438-
// Should have UserPromptSubmit hook for auto-refresh
439-
expect(savedSettings.hooks?.UserPromptSubmit).toBeDefined();
440-
expect(savedSettings.hooks?.UserPromptSubmit?.[0]?.hooks).toBeDefined();
441-
});
442-
443-
it('should backup existing status line before installing challenge', async () => {
444-
const mockSettings = {
445-
hooks: {},
446-
statusLine: {
447-
type: 'command' as const,
448-
command: 'existing-statusline',
449-
padding: 0
450-
}
451-
};
452-
mockSettingsReader.readGlobalSettings.mockResolvedValue(mockSettings);
453-
454-
await manager.installChallengeStatusLineFeature();
455-
456-
expect(mockConfig.saveStatusLineBackup).toHaveBeenCalledWith({
457-
originalCommand: 'existing-statusline',
458-
originalType: 'command',
459-
originalPadding: 0,
460-
backupReason: 'Replaced by vibe-log challenge status line'
461-
});
462-
});
463-
});
464-
465-
describe('removeChallengeStatusLineFeature', () => {
466-
it('should remove challenge status line and hooks', async () => {
467-
const mockSettings = {
468-
hooks: {
469-
UserPromptSubmit: [{
470-
hooks: [
471-
{ type: 'command' as const, command: 'npx vibe-log-cli refresh-push-up-challenge-statusline' }
472-
]
473-
}]
474-
},
475-
statusLine: {
476-
type: 'command' as const,
477-
command: 'npx vibe-log-cli statusline-challenge',
478-
padding: 0
479-
}
480-
};
481-
mockSettingsReader.readGlobalSettings.mockResolvedValue(mockSettings);
482-
483-
await manager.removeChallengeStatusLineFeature();
484-
485-
const savedSettings = mockSettingsReader.writeGlobalSettings.mock.calls[0][0];
486-
expect(savedSettings.hooks?.UserPromptSubmit).toBeUndefined();
487-
expect(savedSettings.statusLine).toBeUndefined();
488-
});
489-
490-
it('should restore backup when requested', async () => {
491-
const mockSettings = {
492-
hooks: {
493-
UserPromptSubmit: [{
494-
hooks: [
495-
{ type: 'command' as const, command: 'npx vibe-log-cli refresh-push-up-challenge-statusline' }
496-
]
497-
}]
498-
},
499-
statusLine: {
500-
type: 'command' as const,
501-
command: 'npx vibe-log-cli statusline-challenge',
502-
padding: 0
503-
}
504-
};
505-
mockSettingsReader.readGlobalSettings.mockResolvedValue(mockSettings);
506-
507-
const backup = {
508-
originalCommand: 'echo "restored"',
509-
originalType: 'command' as const,
510-
originalPadding: 2,
511-
backupReason: 'test'
512-
};
513-
mockConfig.getStatusLineBackup.mockReturnValue(backup);
514-
515-
await manager.removeChallengeStatusLineFeature(true);
516-
517-
const savedSettings = mockSettingsReader.writeGlobalSettings.mock.calls[0][0];
518-
expect(savedSettings.statusLine).toEqual({
519-
type: 'command',
520-
command: 'echo "restored"',
521-
padding: 2
522-
});
523-
expect(mockConfig.clearStatusLineBackup).toHaveBeenCalled();
524-
});
525-
});
526426
});

tests/unit/lib/detector.test.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -225,26 +225,6 @@ describe('detector', () => {
225225
});
226226
});
227227

228-
describe('PUSHUP_ONLY state', () => {
229-
it('should detect PUSHUP_ONLY when only push-up challenge enabled', async () => {
230-
// Push-up challenge requires some config to not be FIRST_TIME
231-
mockGetAllConfig.mockReturnValue({ pushUpChallenge: { enabled: true } });
232-
mockGetToken.mockResolvedValue(null);
233-
mockGetPushUpChallengeConfig.mockReturnValue({ enabled: true });
234-
235-
// Explicitly mock fs to ensure no agents detected
236-
const mockAccess = vi.spyOn(fs, 'access');
237-
mockAccess.mockRejectedValue(new Error('Path does not exist'));
238-
239-
const result = await detectSetupState();
240-
241-
expect(result.state).toBe('PUSHUP_ONLY');
242-
expect(result.hasAuth).toBe(false);
243-
expect(result.hasAgents).toBe(false);
244-
expect(result.hasPushUpChallenge).toBe(true);
245-
});
246-
});
247-
248228
describe('PARTIAL_SETUP state', () => {
249229
it('should detect PARTIAL_SETUP for incomplete configurations', async () => {
250230
mockGetAllConfig.mockReturnValue({ someConfig: 'value' });

0 commit comments

Comments
 (0)