Files
skillshare/tests/integration/status_project_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

48 lines
1.3 KiB
Go

//go:build !online
package integration
import (
"testing"
"skillshare/internal/testutil"
)
func TestStatusProject_ShowsSyncedTargets(t *testing.T) {
sb := testutil.NewSandbox(t)
defer sb.Cleanup()
projectRoot := sb.SetupProjectDir("claude-code", "cursor")
sb.CreateProjectSkill(projectRoot, "skill-a", map[string]string{"SKILL.md": "# A"})
// Sync first
sb.RunCLIInDir(projectRoot, "sync", "-p").AssertSuccess(t)
result := sb.RunCLIInDir(projectRoot, "status", "-p")
result.AssertSuccess(t)
result.AssertOutputContains(t, "merged")
result.AssertOutputContains(t, "1 shared")
}
func TestStatusProject_ShowsUnsynced(t *testing.T) {
sb := testutil.NewSandbox(t)
defer sb.Cleanup()
projectRoot := sb.SetupProjectDir("claude-code")
sb.CreateProjectSkill(projectRoot, "unsynced", map[string]string{"SKILL.md": "# U"})
// Don't sync — should show "has files" (target dir exists but no symlinks)
result := sb.RunCLIInDir(projectRoot, "status", "-p")
result.AssertSuccess(t)
result.AssertOutputContains(t, "has files")
}
func TestStatusProject_ShowsSourceAndTargets(t *testing.T) {
sb := testutil.NewSandbox(t)
defer sb.Cleanup()
projectRoot := sb.SetupProjectDir("claude-code")
result := sb.RunCLIInDir(projectRoot, "status", "-p")
result.AssertSuccess(t)
result.AssertOutputContains(t, "Source")
result.AssertOutputContains(t, "Targets")
}