Fix TestBundledInstall_DefaultAllowlist for empty default set
v0.6.17 emptied defaultBundledPackages, but this test still expected "notes" to be installed via the curated default set. Update assertions to expect nothing installed when the allowlist is empty. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -441,7 +441,8 @@ func TestExportPackage_NotFound(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestBundledInstall_DefaultAllowlist verifies the curated default set behavior.
|
||||
// TestBundledInstall_DefaultAllowlist verifies that an empty allowlist
|
||||
// installs nothing (defaultBundledPackages is empty since v0.6.17).
|
||||
func TestBundledInstall_DefaultAllowlist(t *testing.T) {
|
||||
stores := newTestStores(t)
|
||||
ctx := context.Background()
|
||||
@@ -449,7 +450,7 @@ func TestBundledInstall_DefaultAllowlist(t *testing.T) {
|
||||
bundledDir := t.TempDir()
|
||||
packagesDir := t.TempDir()
|
||||
|
||||
// Create packages: one in default set, one not
|
||||
// Create packages — neither should be installed with empty defaults
|
||||
buildTestPkg(t, bundledDir, map[string]any{
|
||||
"id": "notes", "title": "Notes", "type": "surface", "version": "1.0.0",
|
||||
})
|
||||
@@ -457,19 +458,17 @@ func TestBundledInstall_DefaultAllowlist(t *testing.T) {
|
||||
"id": "regex-tester", "title": "Regex Tester", "type": "extension", "version": "1.0.0",
|
||||
})
|
||||
|
||||
// Empty allowlist → curated defaults
|
||||
// Empty allowlist → empty default set → nothing installed
|
||||
InstallBundledPackages(bundledDir, packagesDir, "", stores, nil)
|
||||
|
||||
// "notes" is in the default set → should be installed
|
||||
pkg, err := stores.Packages.Get(ctx, "notes")
|
||||
if err != nil || pkg == nil {
|
||||
t.Fatal("notes should be installed (in default set)")
|
||||
pkg, _ := stores.Packages.Get(ctx, "notes")
|
||||
if pkg != nil {
|
||||
t.Fatal("notes should NOT be installed (default set is empty)")
|
||||
}
|
||||
|
||||
// "regex-tester" is NOT in the default set → should be filtered
|
||||
pkg, _ = stores.Packages.Get(ctx, "regex-tester")
|
||||
if pkg != nil {
|
||||
t.Fatal("regex-tester should NOT be installed (not in default set)")
|
||||
t.Fatal("regex-tester should NOT be installed (default set is empty)")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user