Skip to content

Commit eda04bf

Browse files
authored
Update fixtures for valid blueprints as per blueprints v2 spec (#214)
In my wpcom work, I found the following valid blueprint fixtures were out of date as per blueprints v2 spec. Our validator flagged them, and it now passes with the changes in this PR. Also, note that these fixtures files are currently not used in the repo. Nor they were in the original commit. Seems like an intermediary artifact. With this PR, we can atleast have them to be upto dated & can possibly start using them in tests that we can add. In #213 I have the entire incorrect valid fixture file in the test, but if they are indeed to kept around, it can also use the fixture file.
1 parent 203ebca commit eda04bf

File tree

4 files changed

+26
-28
lines changed

4 files changed

+26
-28
lines changed

components/Blueprints/Tests/Unit/Validator/fixtures/valid/full-features.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"Test Author",
1010
"Another Author"
1111
],
12-
"authorUrl": "https://example.com",
12+
"homepage": "https://example.com",
1313
"donateLink": "https://example.com/donate",
1414
"tags": [
1515
"test",
@@ -129,11 +129,9 @@
129129
],
130130
"additionalStepsAfterExecution": [
131131
{
132-
"step": "writeFile",
133-
"path": "wp-content/uploads/custom-file.txt",
134-
"content": {
135-
"filename": "custom-file.txt",
136-
"content": "This is a custom file created by the Blueprint."
132+
"step": "writeFiles",
133+
"files": {
134+
"wp-content/uploads/custom-file.txt": "This is a custom file created by the Blueprint."
137135
}
138136
},
139137
{

components/Blueprints/Tests/Unit/Validator/fixtures/valid/with-additional-steps.json

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
{
2424
"step": "activateTheme",
25-
"themeFolderName": "twentytwentythree"
25+
"themeDirectoryName": "twentytwentythree"
2626
},
2727
{
2828
"step": "cp",
@@ -32,18 +32,16 @@
3232
{
3333
"step": "defineConstants",
3434
"constants": {
35-
"WP_DEBUG": "true",
36-
"SCRIPT_DEBUG": "false"
35+
"WP_DEBUG": true,
36+
"SCRIPT_DEBUG": false
3737
}
3838
},
3939
{
4040
"step": "installPlugin",
41-
"plugin": {
42-
"source": "jetpack",
43-
"active": true,
44-
"activationOptions": {
45-
"mode": "development"
46-
}
41+
"source": "jetpack",
42+
"active": true,
43+
"activationOptions": {
44+
"mode": "development"
4745
}
4846
},
4947
{
@@ -58,9 +56,10 @@
5856
}
5957
},
6058
{
61-
"step": "writeFile",
62-
"path": "/path/to/file.txt",
63-
"content": "Hello World"
59+
"step": "writeFiles",
60+
"files": {
61+
"/path/to/file.txt": "Hello World"
62+
}
6463
}
6564
]
6665
}

components/Blueprints/Tests/Unit/Validator/fixtures/valid/with-post-types.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@
5454
}
5555
],
5656
[
57-
"core/paragraph"
57+
"core/paragraph",
58+
{
59+
"content": "This is a sample book."
60+
}
5861
]
5962
],
6063
"template_lock": "all"

components/Blueprints/Tests/Unit/Validator/fixtures/valid/with-steps.json

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
{
2424
"step": "activateTheme",
25-
"themeFolderName": "twentytwentythree"
25+
"themeDirectoryName": "twentytwentythree"
2626
},
2727
{
2828
"step": "cp",
@@ -38,12 +38,12 @@
3838
},
3939
{
4040
"step": "installPlugin",
41-
"plugin": "woocommerce"
41+
"source": "woocommerce"
4242
},
4343
{
4444
"step": "installTheme",
4545
"source": "twentytwentyfour",
46-
"activate": true,
46+
"active": true,
4747
"importStarterContent": true
4848
},
4949
{
@@ -68,7 +68,7 @@
6868
"code": "echo 'Hello, World!';"
6969
},
7070
{
71-
"step": "runSql",
71+
"step": "runSQL",
7272
"source": "./custom-queries.sql"
7373
},
7474
{
@@ -92,11 +92,9 @@
9292
"command": "plugin list --format=json"
9393
},
9494
{
95-
"step": "writeFile",
96-
"path": "wp-content/uploads/new-file.txt",
97-
"content": {
98-
"filename": "content.txt",
99-
"content": "This is the content of the file."
95+
"step": "writeFiles",
96+
"files": {
97+
"wp-content/uploads/new-file.txt": "Content of file."
10098
}
10199
},
102100
{

0 commit comments

Comments
 (0)