Skip to content

Commit 2c95b59

Browse files
committed
test: Demo access to nested and object properties (#3580)
1 parent 9d5e840 commit 2c95b59

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

tests/Scripting/TaskProperties.test.task_frontmatter_properties.approved.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
| `task.file.property('sample_link_property')` | `string` | `'[[yaml_all_property_types_populated]]'` |
1515
| `task.file.property('sample_link_list_property')` | `string[]` | `['[[yaml_all_property_types_populated]]', '[[yaml_all_property_types_empty]]']` |
1616
| `task.file.property('tags')` | `string[]` | `['#tag-from-file-properties']` |
17+
| `task.file.property('nested_data').surname` | `string` | `'Doe'` |
18+
| `task.file.property('nested_data').firstname` | `string` | `'Jane'` |
19+
| `task.file.property('nested_data')['middle name']` | `string` | `'Frances'` |
20+
| `task.file.property('object_serialization').nested1` | `string` | `'value1'` |
21+
| `task.file.property('object_serialization').nested2` | `string` | `'value2'` |
1722

1823

1924
<!-- placeholder to force blank line after included text -->

tests/Scripting/TaskProperties.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,14 @@ describe('task', () => {
188188
"task.file.property('sample_link_property')",
189189
"task.file.property('sample_link_list_property')",
190190
"task.file.property('tags')",
191+
192+
"task.file.property('nested_data').surname",
193+
"task.file.property('nested_data').firstname",
194+
"task.file.property('nested_data')['middle name']",
195+
196+
"task.file.property('object_serialization').nested1",
197+
"task.file.property('object_serialization').nested2",
198+
191199
// 'task.file.tags', // TODO Replace
192200
// 'task.file.tags()', // TODO Implement
193201
// "task.file.tags('body')", // TODO Implement

0 commit comments

Comments
 (0)