feat(09-03): scaffold Winter admin controller layout
- config_form.yaml and config_list.yaml point at models/<name>/fields.yaml and columns.yaml - Duplicate model or controller assets fail before any new file is written
This commit is contained in:
@@ -714,10 +714,12 @@ func TestScaffoldAllArtifacts(t *testing.T) {
|
||||
}
|
||||
wantAdmin := []string{
|
||||
filepath.Join(pluginDir, "controllers", "albums.go"),
|
||||
filepath.Join(pluginDir, "controllers", "albums", "fields.yaml"),
|
||||
filepath.Join(pluginDir, "controllers", "albums", "columns.yaml"),
|
||||
filepath.Join(pluginDir, "controllers", "albums", "config_form.yaml"),
|
||||
filepath.Join(pluginDir, "controllers", "albums", "config_list.yaml"),
|
||||
filepath.Join(pluginDir, "models", "albums", "fields.yaml"),
|
||||
filepath.Join(pluginDir, "models", "albums", "columns.yaml"),
|
||||
}
|
||||
if len(admin.Files) != 3 {
|
||||
if len(admin.Files) != len(wantAdmin) {
|
||||
t.Fatalf("make:admin-controller files = %v", admin.Files)
|
||||
}
|
||||
for i, want := range wantAdmin {
|
||||
@@ -739,8 +741,8 @@ func TestScaffoldAllArtifacts(t *testing.T) {
|
||||
}
|
||||
}
|
||||
for _, rel := range []string{
|
||||
filepath.Join("controllers", "albums", "fields.yaml"),
|
||||
filepath.Join("controllers", "albums", "columns.yaml"),
|
||||
filepath.Join("models", "albums", "fields.yaml"),
|
||||
filepath.Join("models", "albums", "columns.yaml"),
|
||||
} {
|
||||
body, err := os.ReadFile(filepath.Join(pluginDir, rel))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user