summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrail Finder (aider) <wohilas@gmail.com>2025-04-05 15:34:39 +0300
committerGrail Finder (aider) <wohilas@gmail.com>2025-04-05 15:34:39 +0300
commit1cba383c5f8781218eb71bfefa667f72dd01a58a (patch)
tree05e3a20d2e410377982bae989d879ae921ba7316
parent77e6fdb0d437b03cd5d8174934006d100e8ecee7 (diff)
test: update handlers test to use real question from db
-rw-r--r--internal/handlers/handlers_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/handlers/handlers_test.go b/internal/handlers/handlers_test.go
index 89f4d73..be5607f 100644
--- a/internal/handlers/handlers_test.go
+++ b/internal/handlers/handlers_test.go
@@ -53,7 +53,7 @@ func TestQuestionFlow(t *testing.T) {
if err != nil {
assert.FailNow("Failed to get question text", err)
}
- assert.Contains(questionText, "Zweifel", "Question text should contain 'Zweifel'")
+ assert.Contains(questionText, "___ hast du heute Zeit?", "Question text should contain the actual question text from DB")
// Set longer timeout for CI environment
page.SetDefaultTimeout(5000)
@@ -69,20 +69,20 @@ func TestQuestionFlow(t *testing.T) {
assert.True(visible, "Option %d not visible", i)
}
- // Test correct answer (option2 is correct per test data)
- err = page.Locator("[data-testid='option2']").Click()
+ // Test correct answer (option3 is correct per DB data)
+ err = page.Locator("[data-testid='option3']").Click()
assert.NoError(err)
// Wait for feedback to update and verify
- err = page.Locator("[data-testid='feedback']:has-text('Correct')").WaitFor()
+ err = page.Locator("[data-testid='feedback']:has-text('zu welchem Zeitpunkt')").WaitFor()
assert.NoError(err, "Correct answer feedback not shown")
// Test wrong answer
err = page.Locator("[data-testid='option1']").Click()
assert.NoError(err)
- // Wait for feedback to update and verify
- err = page.Locator("[data-testid='feedback']:has-text('Wrong')").WaitFor()
+ // Wait for feedback to update and verify - using actual explanation from DB
+ err = page.Locator("[data-testid='feedback']:has-text('Wann: zu welchem Zeitpunkt')").WaitFor()
assert.NoError(err, "Wrong answer feedback not shown")
}