-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtemplate_test.go
More file actions
23 lines (19 loc) 路 870 Bytes
/
Copy pathtemplate_test.go
File metadata and controls
23 lines (19 loc) 路 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package main
import (
"testing"
)
func TestBuildCommitTemplate_NoTicket(t *testing.T) {
// This is a smoke test for template generation logic (not for editor interaction)
ct := &CommitType{"feature", "feat", "馃殌", "Feature"}
ticket := ""
changelog := "- ..."
affected := "changed.go"
ticketBlock := ""
template := buildCommitTemplate(ct, ticket, changelog, affected, ticketBlock)
if template == "" || template == "EDIT TITLE" {
t.Error("template should not be empty or default")
}
}
func buildCommitTemplate(commitType *CommitType, ticket, changelog, affected, ticketBlock string) string {
return commitType.Emoji + " " + commitType.DisplayName + ": EDIT TITLE " + formatTicket1(ticket) + "\n\n馃摑 Description:\nExplain what this commit does and why.\n\n馃摝 Changelog:\n" + changelog + "\n\n馃搧 Affected files:\n" + affected + ticketBlock + "\n"
}