mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-19 02:17:09 +00:00
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
36 lines
720 B
Go
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")
|
|
}
|