diff --git a/src/cmd/cmd_test.go b/src/cmd/cmd_test.go index d3678ea..3fb045d 100644 --- a/src/cmd/cmd_test.go +++ b/src/cmd/cmd_test.go @@ -10,9 +10,29 @@ import ( "github.com/Slug-Boi/cocommit/src/cmd/utils" ) -const author_data = `syntax for the test file -te|testing|TestUser|test@test.test|ex -ti|testtest|UserName2|testing@user.io;;gr1` +const author_data = ` +{ + "Authors": { + "testing": { + "shortname": "te", + "longname": "testing", + "username": "TestUser", + "email": "test@test.test", + "ex": true, + "groups": [] + }, + "testtest": { + "shortname": "ti", + "longname": "testtest", + "username": "UserName2", + "email": "testing@user.io", + "ex": false, + "groups": [ + "gr1" + ] + } + } +}` var envVar = utils.Find_authorfile() diff --git a/src/cmd/tui/tui_test.go b/src/cmd/tui/tui_test.go index 526a0df..2889ff1 100644 --- a/src/cmd/tui/tui_test.go +++ b/src/cmd/tui/tui_test.go @@ -12,9 +12,29 @@ import ( "github.com/charmbracelet/x/exp/teatest" ) -const author_data = `syntax for the test file -te|testing|TestUser|test@test.test|ex;;gr0 -ti|testtest|UserName2|testing@user.io;;gr1` +const author_data = ` +{ + "Authors": { + "testing": { + "shortname": "te", + "longname": "testing", + "username": "TestUser", + "email": "test@test.test", + "ex": true, + "groups": [] + }, + "testtest": { + "shortname": "ti", + "longname": "testtest", + "username": "UserName2", + "email": "testing@user.io", + "ex": false, + "groups": [ + "gr1" + ] + } + } +}` var envVar string @@ -54,7 +74,7 @@ func TestShowUser(t *testing.T) { teatest.WithInitialTermSize(300, 300), ) teatest.WaitFor(t, tm.Output(), func(bts []byte) bool { - return bytes.Contains(bts, []byte("syntax for the test file")) + return bytes.Contains(bts, []byte("\"Authors\": {")) }, teatest.WithCheckInterval(time.Millisecond*100), teatest.WithDuration(time.Second*2)) keyPress(tm, "q") diff --git a/src/cmd/utils/util_test.go b/src/cmd/utils/util_test.go index 3a66d3f..58823b6 100644 --- a/src/cmd/utils/util_test.go +++ b/src/cmd/utils/util_test.go @@ -6,9 +6,29 @@ import ( "testing" ) -const author_data = `syntax for the test file -te|testing|TestUser|test@test.test|ex -ti|testtest|UserName2|testing@user.io;;gr1` +const author_data = ` +{ + "Authors": { + "testing": { + "shortname": "te", + "longname": "testing", + "username": "TestUser", + "email": "test@test.test", + "ex": true, + "groups": [] + }, + "testtest": { + "shortname": "ti", + "longname": "testtest", + "username": "UserName2", + "email": "testing@user.io", + "ex": false, + "groups": [ + "gr1" + ] + } + } +}` var envVar = os.Getenv("author_file")