Finish the D&D module cleanup
This commit is contained in:
@@ -409,6 +409,28 @@ func TestAppendCombatTurnListsPreservesOrderPresenceAndOwnership(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestAppendListsPreserveNestedSourceReferencePresence(t *testing.T) {
|
||||
spells, err := appendSpellLists([]dnd.SpellList{{SpellCasts: []dnd.SpellCast{{SourceRefs: []source.SourceRef{}}}}})
|
||||
if err != nil || spells.SpellCasts[0].SourceRefs == nil {
|
||||
t.Fatalf("appendSpellLists() = %#v, %v; want present-empty source refs", spells, err)
|
||||
}
|
||||
|
||||
npcs, err := appendNPCLists([]dnd.NPCList{{NPCs: []dnd.NPC{{SourceRefs: []source.SourceRef{}}}}})
|
||||
if err != nil || npcs.NPCs[0].SourceRefs == nil {
|
||||
t.Fatalf("appendNPCLists() = %#v, %v; want present-empty source refs", npcs, err)
|
||||
}
|
||||
|
||||
turns, err := appendCombatTurnLists([]dnd.CombatTurnList{{CombatTurns: []dnd.CombatTurn{{SourceRefs: []source.SourceRef{}}}}})
|
||||
if err != nil || turns.CombatTurns[0].SourceRefs == nil {
|
||||
t.Fatalf("appendCombatTurnLists() = %#v, %v; want present-empty source refs", turns, err)
|
||||
}
|
||||
|
||||
interactions, err := appendNPCInteractionLists([]dnd.NPCInteractionList{{Interactions: []dnd.NPCInteraction{{SourceRefs: []source.SourceRef{}}}}})
|
||||
if err != nil || interactions.Interactions[0].SourceRefs == nil {
|
||||
t.Fatalf("appendNPCInteractionLists() = %#v, %v; want present-empty source refs", interactions, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRegisterRejectsMissingDNDDependenciesBeforeMutation(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
|
||||
Reference in New Issue
Block a user