|
146 | 146 | } |
147 | 147 | }; |
148 | 148 |
|
149 | | - const withModifiers = (activity, { position, status, abstract, howToStatus }) => ({ |
| 149 | + const withModifiers = (activity, { position, status, abstract, howToStatus, howToAbstract }) => ({ |
150 | 150 | ...activity, |
151 | 151 | entities: activity.entities.map(entity => ({ |
152 | 152 | ...entity, |
|
155 | 155 | creativeWorkStatus: status, |
156 | 156 | isPartOf: { |
157 | 157 | ...entity.isPartOf, |
158 | | - ...(typeof howToStatus !== 'undefined' ? { creativeWorkStatus: howToStatus } : {}) |
| 158 | + ...(typeof howToStatus !== 'undefined' ? { creativeWorkStatus: howToStatus } : {}), |
| 159 | + ...(typeof howToAbstract !== 'undefined' ? { abstract: howToAbstract } : {}) |
159 | 160 | } |
160 | 161 | })) |
161 | 162 | }); |
|
260 | 261 |
|
261 | 262 | // Test Case 8: HowTo-level status takes precedence |
262 | 263 | // When: setting the HowTo entity's creativeWorkStatus to 'Incomplete' while messages have 'Published' |
263 | | - directLine.emulateIncomingActivity(withModifiers(activities.at(0), { status: 'Published', abstract: 'one done', howToStatus: 'Incomplete' })); |
| 264 | + directLine.emulateIncomingActivity(withModifiers(activities.at(0), { status: 'Published', abstract: 'one done', howToStatus: 'Incomplete', howToAbstract: 'HowTo in progress' })); |
264 | 265 |
|
265 | 266 | // Then: the group header should show 'Incomplete' because the HowTo status takes precedence over derived message status |
266 | 267 | await pageConditions.numActivitiesShown(6); |
267 | 268 | await host.snapshot('local'); |
268 | 269 |
|
269 | 270 | // Test Case 9: HowTo-level status set to 'Published' overrides message-derived status |
270 | 271 | // When: a message is 'Incomplete' but the HowTo entity is explicitly 'Published' |
271 | | - directLine.emulateIncomingActivity(withModifiers(activities.at(3), { status: 'Incomplete', abstract: 'four in progress again', howToStatus: 'Published' })); |
| 272 | + directLine.emulateIncomingActivity(withModifiers(activities.at(3), { status: 'Incomplete', abstract: 'four in progress again', howToStatus: 'Published', howToAbstract: 'HowTo completed' })); |
272 | 273 |
|
273 | 274 | // Then: the group header should show 'Published' from the HowTo, not 'Incomplete' from the message |
274 | 275 | await pageConditions.numActivitiesShown(6); |
|
0 commit comments