Empty Reps field defaults to 1

This commit is contained in:
AG
2025-12-11 22:27:25 +02:00
parent e9142d1e1c
commit 70ea0a0ac3
4 changed files with 26 additions and 4 deletions

View File

@@ -482,4 +482,26 @@ test.describe('III. Workout Tracking', () => {
test('3.16 C. Active Session - Log Set with Default Reps', async ({ page, createUniqueUser, request }) => {
const user = await loginAndSetup(page, createUniqueUser);
const exName = 'Default Reps ' + randomUUID().slice(0, 4);
await request.post('/api/exercises', {
data: { name: exName, type: 'STRENGTH' },
headers: { 'Authorization': `Bearer ${user.token}` }
});
await page.getByRole('button', { name: /Free Workout|Start Empty/i }).click();
await page.getByRole('textbox', { name: /Select Exercise/i }).click();
await page.getByText(exName).click();
await page.getByLabel('Weight (kg)').first().fill('50');
// Reps left empty intentionally
await page.getByRole('button', { name: /Log Set/i }).click();
// Verify it logged as 1 rep
await expect(page.getByText('50 kg x 1 reps')).toBeVisible();
});
});