diff options
author | Grail Finder (aider) <wohilas@gmail.com> | 2025-04-05 15:55:42 +0300 |
---|---|---|
committer | Grail Finder (aider) <wohilas@gmail.com> | 2025-04-05 15:55:42 +0300 |
commit | e7e0bc7113ffe38273848c79e77b6c90dfaa93f4 (patch) | |
tree | 7cd61f7cd139000ca7cdaba66312d458de3ee041 /internal/handlers/handlers_test.go | |
parent | 5862de4e0cbe43ee273461043a230fa16ac049cc (diff) |
test: update question flow test assertions and feedback structure
Diffstat (limited to 'internal/handlers/handlers_test.go')
-rw-r--r-- | internal/handlers/handlers_test.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/internal/handlers/handlers_test.go b/internal/handlers/handlers_test.go index be5607f..9de63b4 100644 --- a/internal/handlers/handlers_test.go +++ b/internal/handlers/handlers_test.go @@ -53,7 +53,8 @@ func TestQuestionFlow(t *testing.T) { if err != nil { assert.FailNow("Failed to get question text", err) } - assert.Contains(questionText, "___ hast du heute Zeit?", "Question text should contain the actual question text from DB") + assert.Contains(questionText, "___ hast du heute Zeit?", "Question text should match database entry") + assert.Contains(questionText, "(Test Question)", "Question text should contain test indicator") // Set longer timeout for CI environment page.SetDefaultTimeout(5000) @@ -74,7 +75,8 @@ func TestQuestionFlow(t *testing.T) { assert.NoError(err) // Wait for feedback to update and verify - err = page.Locator("[data-testid='feedback']:has-text('zu welchem Zeitpunkt')").WaitFor() + // Check for success styling and explanation + err = page.Locator(".correct-feedback:has-text('Wann: zu welchem Zeitpunkt')").WaitFor() assert.NoError(err, "Correct answer feedback not shown") // Test wrong answer @@ -82,7 +84,8 @@ func TestQuestionFlow(t *testing.T) { assert.NoError(err) // 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() + // Check for error styling and explanation + err = page.Locator(".error-feedback:has-text('Wann: zu welchem Zeitpunkt')").WaitFor() assert.NoError(err, "Wrong answer feedback not shown") } |