Files
skillshare/tests/integration/ui_test.go
T
Willie 98db20a9a0 test: add !online build tag to offline integration tests
Prevent test-docker and test-docker-online from running the same 36
offline integration tests. Each offline test file now has
`//go:build !online` so the two sets are mutually exclusive:
- default (no tag): 36 offline tests only
- -tags online: online tests only
2026-02-11 03:40:54 +08:00

36 lines
720 B
Go

//go:build !online
package integration
import (
"path/filepath"
"testing"
"skillshare/internal/testutil"
)
func TestUI_NoConfig_ReturnsInitError(t *testing.T) {
sb := testutil.NewSandbox(t)
defer sb.Cleanup()
result := sb.RunCLI("ui", "--no-open")
result.AssertFailure(t)
result.AssertAnyOutputContains(t, "run 'skillshare init' first")
}
func TestUI_SourceMissing_ReturnsInitError(t *testing.T) {
sb := testutil.NewSandbox(t)
defer sb.Cleanup()
missingSource := filepath.Join(sb.Root, "missing-source")
sb.WriteConfig(`source: ` + missingSource + `
targets: {}
`)
result := sb.RunCLI("ui", "--no-open")
result.AssertFailure(t)
result.AssertAnyOutputContains(t, "run 'skillshare init' first")
}