You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(tests): add test for JSON-download datafile action (#1868)
## Description
These two specs verify the “json-download” action type in the
`perform_action()`:
1. `0600` ensures that when a custom payload template is provided,
placeholders ({{ datasetPid }}, {{ sourceFolder }}, {{ filesPath }}, {{
jwt }}) are correctly replaced and sent in the request body.
2. `0610` ensures that if payload is missing (empty), the default object
(auth_token, jwt, dataset, directory, files) is still constructed and
sent.
## Motivation
To guarantee that both code paths for JSON‐based downloads produce a
valid POST body—whether using a user-supplied template or falling back
to the built-in default—so downstream services always receive the
expected parameters.
## Fixes:
Please provide a list of the fixes implemented in this PR
* Items added
## Changes:
Please provide a list of the changes implemented by this PR
* changes made
## Tests included
- [ ] Included for each change/fix?
- [ ] Passing? (Merge will not be approved unless this is checked)
## Documentation
- [ ] swagger documentation updated \[required\]
- [ ] official documentation updated \[nice-to-have\]
### official documentation info
If you have updated the official documentation, please provide PR # and
URL of the pages where the updates are included
## Backend version
- [ ] Does it require a specific version of the backend
- which version of the backend is required:
## Summary by Sourcery
Add unit tests for the JSON-download branch of DatafilesActionComponent
to ensure both custom payload templates and fallback defaults produce
the correct POST body
Tests:
- Update test configuration by reordering action entries and adding two
JSON-download cases
- Verify that a provided payload template correctly replaces
placeholders and is sent in the request body
- Verify that an empty payload triggers construction and sending of the
default JSON payload
0 commit comments