Skip to content

Commit 11c1679

Browse files
committed
Verify progress reset dialog is present and working
1 parent 0bd595d commit 11c1679

8 files changed

Lines changed: 1505 additions & 1 deletion

File tree

__tests__/app/problems/[id]/page.test.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,4 +970,23 @@ describe('Problem Page Edge Cases', () => {
970970
expect(screen.getByTestId('error-message')).toHaveTextContent(/No code to test/i);
971971
});
972972
});
973+
974+
it('should not call runTests when code is empty', async () => {
975+
// Use the prev-problem which has empty starterCode
976+
mockParams.id = 'prev-problem';
977+
978+
renderWithProgress(<ProblemPage />);
979+
980+
// prev-problem has starterCode: '' (empty string)
981+
const runButton = screen.getByRole('button', { name: /Run Tests/i });
982+
983+
await act(async () => {
984+
fireEvent.click(runButton);
985+
});
986+
987+
// The validation should prevent calling runTests
988+
expect(mockRunTests).not.toHaveBeenCalled();
989+
});
990+
991+
973992
});

0 commit comments

Comments
 (0)