@@ -28,12 +28,14 @@ import (
2828func Test_App_UpdateDefaultProjectFiles (t * testing.T ) {
2929 tests := map [string ]struct {
3030 appDirName string
31+ displayName string
3132 existingFiles map [string ]string
3233 expectedFiles map [string ]string
3334 expectedErrorType error
3435 }{
3536 "manifest.json file exists" : {
36- appDirName : "vibrant-butterfly-1234" ,
37+ appDirName : "vibrant-butterfly-1234" ,
38+ displayName : "Vibrant Butterfly 1234" ,
3739 existingFiles : map [string ]string {
3840 "manifest.json" : string (testdata .ManifestJSON ),
3941 },
@@ -43,7 +45,8 @@ func Test_App_UpdateDefaultProjectFiles(t *testing.T) {
4345 expectedErrorType : nil ,
4446 },
4547 "manifest.js file exists" : {
46- appDirName : "vibrant-butterfly-1234" ,
48+ appDirName : "vibrant-butterfly-1234" ,
49+ displayName : "Vibrant Butterfly 1234" ,
4750 existingFiles : map [string ]string {
4851 "manifest.js" : string (testdata .ManifestJS ),
4952 },
@@ -53,7 +56,8 @@ func Test_App_UpdateDefaultProjectFiles(t *testing.T) {
5356 expectedErrorType : nil ,
5457 },
5558 "manifest.ts file exists" : {
56- appDirName : "vibrant-butterfly-1234" ,
59+ appDirName : "vibrant-butterfly-1234" ,
60+ displayName : "Vibrant Butterfly 1234" ,
5761 existingFiles : map [string ]string {
5862 "manifest.ts" : string (testdata .ManifestTS ),
5963 },
@@ -63,7 +67,8 @@ func Test_App_UpdateDefaultProjectFiles(t *testing.T) {
6367 expectedErrorType : nil ,
6468 },
6569 "Multiple manifest files exist" : {
66- appDirName : "vibrant-butterfly-1234" ,
70+ appDirName : "vibrant-butterfly-1234" ,
71+ displayName : "Vibrant Butterfly 1234" ,
6772 existingFiles : map [string ]string {
6873 "manifest.json" : string (testdata .ManifestJSON ),
6974 "manifest.ts" : string (testdata .ManifestTS ),
@@ -75,7 +80,8 @@ func Test_App_UpdateDefaultProjectFiles(t *testing.T) {
7580 expectedErrorType : nil ,
7681 },
7782 "package.json file exists" : {
78- appDirName : "vibrant-butterfly-1234" ,
83+ appDirName : "vibrant-butterfly-1234" ,
84+ displayName : "Vibrant Butterfly 1234" ,
7985 existingFiles : map [string ]string {
8086 "package.json" : string (testdata .PackageJSON ),
8187 },
@@ -85,7 +91,8 @@ func Test_App_UpdateDefaultProjectFiles(t *testing.T) {
8591 expectedErrorType : nil ,
8692 },
8793 "pyproject.toml file exists" : {
88- appDirName : "vibrant-butterfly-1234" ,
94+ appDirName : "vibrant-butterfly-1234" ,
95+ displayName : "Vibrant Butterfly 1234" ,
8996 existingFiles : map [string ]string {
9097 "pyproject.toml" : string (testdata .PyprojectTOML ),
9198 },
@@ -95,7 +102,8 @@ func Test_App_UpdateDefaultProjectFiles(t *testing.T) {
95102 expectedErrorType : nil ,
96103 },
97104 "Multiple project files exist" : {
98- appDirName : "vibrant-butterfly-1234" ,
105+ appDirName : "vibrant-butterfly-1234" ,
106+ displayName : "Vibrant Butterfly 1234" ,
99107 existingFiles : map [string ]string {
100108 "manifest.json" : string (testdata .ManifestJSON ),
101109 "package.json" : string (testdata .PackageJSON ),
@@ -110,6 +118,7 @@ func Test_App_UpdateDefaultProjectFiles(t *testing.T) {
110118 },
111119 "No manifest files exist" : {
112120 appDirName : "vibrant-butterfly-1234" ,
121+ displayName : "Vibrant Butterfly 1234" ,
113122 existingFiles : map [string ]string {},
114123 expectedFiles : map [string ]string {},
115124 expectedErrorType : nil ,
@@ -136,7 +145,7 @@ func Test_App_UpdateDefaultProjectFiles(t *testing.T) {
136145 }
137146
138147 // Run the tests
139- err := UpdateDefaultProjectFiles (fs , projectDirPath , tc .appDirName )
148+ err := UpdateDefaultProjectFiles (fs , projectDirPath , tc .appDirName , tc . displayName )
140149
141150 // Assertions
142151 require .IsType (t , err , tc .expectedErrorType )
@@ -151,32 +160,6 @@ func Test_App_UpdateDefaultProjectFiles(t *testing.T) {
151160 }
152161}
153162
154- func Test_kebabToTitleCase (t * testing.T ) {
155- tests := map [string ]struct {
156- input string
157- expected string
158- }{
159- "multiple words" : {
160- input : "my-app" ,
161- expected : "My App" ,
162- },
163- "multiple words with numbers" : {
164- input : "vibrant-butterfly-1234" ,
165- expected : "Vibrant Butterfly 1234" ,
166- },
167- "single word" : {
168- input : "hello" ,
169- expected : "Hello" ,
170- },
171- }
172- for name , tc := range tests {
173- t .Run (name , func (t * testing.T ) {
174- result := kebabToTitleCase (tc .input )
175- require .Equal (t , tc .expected , result )
176- })
177- }
178- }
179-
180163func Test_RegexReplaceAppNameInManifest (t * testing.T ) {
181164 tests := map [string ]struct {
182165 src []byte
0 commit comments