feat: pantalla de tests en el dashboard TUI
Nueva seccion "Tests" en el menu principal del dashboard que permite ejecutar Go tests, E2E tests (headless y headed), y todos secuencialmente. - ScreenTests con menu de seleccion de tipo de test - TestKind enum para identificar el tipo de test ejecutado - Nuevos intents: IntentRunGoTests, IntentRunE2ETests, IntentRunE2EHeadTests, IntentRunAllTests - LastTestKind en Model para re-ejecucion con "r" - runGoTests, runE2ETests, runAllTests en adapter - "Run Tests" en Server menu reemplazado por navegacion a ScreenTests - Test output muestra tipo de test en titulo y vuelve a ScreenTests con "0" Issue: 0023 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+38
-1
@@ -18,6 +18,8 @@ func View(model Model) string {
|
||||
return viewLogs(model)
|
||||
case ScreenServer:
|
||||
return viewServer(model)
|
||||
case ScreenTests:
|
||||
return viewTests(model)
|
||||
case ScreenTestOutput:
|
||||
return viewTestOutput(model)
|
||||
default:
|
||||
@@ -238,10 +240,45 @@ func viewServer(m Model) string {
|
||||
return b.String()
|
||||
}
|
||||
|
||||
func viewTests(m Model) string {
|
||||
var b strings.Builder
|
||||
|
||||
b.WriteString("\n Tests\n")
|
||||
b.WriteString(" " + strings.Repeat("─", 44) + "\n")
|
||||
|
||||
for i, opt := range TestMenuOptions() {
|
||||
cursor := " "
|
||||
if i == m.Cursor {
|
||||
cursor = "> "
|
||||
}
|
||||
b.WriteString(fmt.Sprintf(" %s%-22s %s\n", cursor, opt.Label, opt.Desc))
|
||||
}
|
||||
|
||||
if m.LastTestKind != TestKindNone {
|
||||
b.WriteString(fmt.Sprintf("\n Last run: %s", testKindLabel(m.LastTestKind)))
|
||||
if m.StatusMsg != "" && (strings.HasSuffix(m.StatusMsg, "PASSED") || strings.HasSuffix(m.StatusMsg, "FAILED")) {
|
||||
// Extract result from status
|
||||
if strings.HasSuffix(m.StatusMsg, "PASSED") {
|
||||
b.WriteString(" — PASSED")
|
||||
} else {
|
||||
b.WriteString(" — FAILED")
|
||||
}
|
||||
}
|
||||
b.WriteString("\n")
|
||||
}
|
||||
|
||||
b.WriteString("\n ↑↓ navegar enter ejecutar 0 volver\n")
|
||||
return b.String()
|
||||
}
|
||||
|
||||
func viewTestOutput(m Model) string {
|
||||
var b strings.Builder
|
||||
|
||||
b.WriteString("\n Test Results\n")
|
||||
title := "Test Results"
|
||||
if m.LastTestKind != TestKindNone {
|
||||
title = "Test Results — " + testKindLabel(m.LastTestKind)
|
||||
}
|
||||
b.WriteString("\n " + title + "\n")
|
||||
b.WriteString(" " + strings.Repeat("─", 60) + "\n")
|
||||
|
||||
if m.StatusMsg != "" {
|
||||
|
||||
Reference in New Issue
Block a user