Skip to content

Commit ccb0504

Browse files
committed
test(behat): add repair scenario for orphaned field values
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 1315deb commit ccb0504

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Feature: orphaned profile field value repair
2+
Background:
3+
Given user "repairuser" exists
4+
And run the command "profile_fields:developer:reset --all" with result code 0
5+
6+
Scenario: maintenance:repair removes values for deleted users without errors
7+
Given as user "admin"
8+
When sending "post" to ocs "/apps/profile_fields/api/v1/definitions"
9+
| fieldKey | repair_test_field |
10+
| label | Repair test |
11+
| type | text |
12+
| editPolicy | users |
13+
| exposurePolicy | private |
14+
| sortOrder | 10 |
15+
| active | true |
16+
Then the response should have a status code 201
17+
And fetch field "(REPAIR_FIELD_ID)(jq).ocs.data.id" from previous JSON response
18+
When sending "put" to ocs "/apps/profile_fields/api/v1/users/repairuser/values/<REPAIR_FIELD_ID>"
19+
| value | orphaned |
20+
Then the response should have a status code 200
21+
And run the command "user:delete repairuser" with result code 0
22+
And run the command "maintenance:repair" with result code 0
23+
And the output of the last command should contain the following text:
24+
"""
25+
Repair orphaned profile field values
26+
"""

0 commit comments

Comments
 (0)