/internal/importer/importer_test.go: remove skipped tests

This commit is contained in:
Test
2026-01-21 13:40:06 -08:00
parent b849f598d7
commit 0a9bcc2dd0
+54 -64
View File
@@ -153,10 +153,10 @@ func TestFieldComparator_StringConversion(t *testing.T) {
fc := newFieldComparator() fc := newFieldComparator()
tests := []struct { tests := []struct {
name string name string
value interface{} value interface{}
wantStr string wantStr string
wantOk bool wantOk bool
}{ }{
{"string", "hello", "hello", true}, {"string", "hello", "hello", true},
{"string pointer", stringPtr("world"), "world", true}, {"string pointer", stringPtr("world"), "world", true},
@@ -436,67 +436,67 @@ func TestRenameImportedIssuePrefixes(t *testing.T) {
func TestReplaceBoundaryAware(t *testing.T) { func TestReplaceBoundaryAware(t *testing.T) {
tests := []struct { tests := []struct {
name string name string
text string text string
oldID string oldID string
newID string newID string
want string want string
}{ }{
{ {
name: "simple replacement", name: "simple replacement",
text: "See old-1 for details", text: "See old-1 for details",
oldID: "old-1", oldID: "old-1",
newID: "new-1", newID: "new-1",
want: "See new-1 for details", want: "See new-1 for details",
}, },
{ {
name: "multiple occurrences", name: "multiple occurrences",
text: "old-1 and old-1 again", text: "old-1 and old-1 again",
oldID: "old-1", oldID: "old-1",
newID: "new-1", newID: "new-1",
want: "new-1 and new-1 again", want: "new-1 and new-1 again",
}, },
{ {
name: "no match substring prefix", name: "no match substring prefix",
text: "old-10 should not match", text: "old-10 should not match",
oldID: "old-1", oldID: "old-1",
newID: "new-1", newID: "new-1",
want: "old-10 should not match", want: "old-10 should not match",
}, },
{ {
name: "match at end of longer ID", name: "match at end of longer ID",
text: "should not match old-1 at end", text: "should not match old-1 at end",
oldID: "old-1", oldID: "old-1",
newID: "new-1", newID: "new-1",
want: "should not match new-1 at end", want: "should not match new-1 at end",
}, },
{ {
name: "boundary at start", name: "boundary at start",
text: "old-1 starts here", text: "old-1 starts here",
oldID: "old-1", oldID: "old-1",
newID: "new-1", newID: "new-1",
want: "new-1 starts here", want: "new-1 starts here",
}, },
{ {
name: "boundary at end", name: "boundary at end",
text: "ends with old-1", text: "ends with old-1",
oldID: "old-1", oldID: "old-1",
newID: "new-1", newID: "new-1",
want: "ends with new-1", want: "ends with new-1",
}, },
{ {
name: "boundary punctuation", name: "boundary punctuation",
text: "See (old-1) and [old-1] or {old-1}", text: "See (old-1) and [old-1] or {old-1}",
oldID: "old-1", oldID: "old-1",
newID: "new-1", newID: "new-1",
want: "See (new-1) and [new-1] or {new-1}", want: "See (new-1) and [new-1] or {new-1}",
}, },
{ {
name: "no occurrence", name: "no occurrence",
text: "No match here", text: "No match here",
oldID: "old-1", oldID: "old-1",
newID: "new-1", newID: "new-1",
want: "No match here", want: "No match here",
}, },
} }
@@ -547,9 +547,9 @@ func TestIsValidIDSuffix(t *testing.T) {
{"abc.1.2.3", true}, {"abc.1.2.3", true},
{"1.5", true}, {"1.5", true},
// Invalid suffixes // Invalid suffixes
{"", false}, // Empty string {"", false}, // Empty string
{"A3F8", false}, // Uppercase not allowed {"A3F8", false}, // Uppercase not allowed
{"@#$!", false}, // Special characters not allowed {"@#$!", false}, // Special characters not allowed
{"abc-def", false}, // Hyphens not allowed in suffix {"abc-def", false}, // Hyphens not allowed in suffix
} }
@@ -811,17 +811,7 @@ func TestImportIssues_Labels(t *testing.T) {
} }
} }
func TestGetOrCreateStore_ExistingStore(t *testing.T) { // NOTE: getOrCreateStore was removed; importer now requires an initialized store.
t.Skip("getOrCreateStore removed: importer now requires a store")
}
func TestGetOrCreateStore_NewStore(t *testing.T) {
t.Skip("getOrCreateStore removed: importer now requires a store")
}
func TestGetOrCreateStore_EmptyPath(t *testing.T) {
t.Skip("getOrCreateStore removed: importer now requires a store")
}
func TestImportIssues_RequiresStore(t *testing.T) { func TestImportIssues_RequiresStore(t *testing.T) {
ctx := context.Background() ctx := context.Background()
@@ -1144,7 +1134,7 @@ func TestImportOrphanSkip_CountMismatch(t *testing.T) {
UpdatedAt: now, UpdatedAt: now,
}, },
{ {
ID: "test-orphan.1", // Child of non-existent parent ID: "test-orphan.1", // Child of non-existent parent
Title: "Orphaned Child", Title: "Orphaned Child",
Status: types.StatusOpen, Status: types.StatusOpen,
Priority: 2, Priority: 2,