@unito/integration-debugger
Version:
The Unito Integration Debugger
53 lines (52 loc) • 1.34 kB
TypeScript
import * as CrawlerDriver from '../crawlerDriver';
/**
* Check: Update a valid item
*
* When canUpdateItem is set to true, it is assumed one can PATCH a record with the item's path.
* It accepts a Fields object, and must return the updated version of an Item on success with a 200 status code,
* or an Error on failure with a 422 status code.
*
* This check seek to generate a **VALID** payload for a given item and exercise the integration to validate that it can
* update the corresponding Item successfully.
*
*
* @example
* For the following item...
*
* ```json
* {
* "fields": {},
* "relations": [{
* "name": "foos",
* "label": "Foos",
* "path": "/foos",
* "schema": {
* "canCreateItem": false,
* "canCreateItem": true,
* "fields": [
* {
* "name": "id",
* "type": "string",
* "readOnly": true
* },
* {
* "name": "value",
* "type": "string",
* "readOnly": false
* }]
* }
* }]
* }
* ```
*
* ... we try a `PATCH /foos/path` where path points to the first foo Item of the Collection with the following payload,
* where only the field that are not readOnly are present:
*
* ```json
* {
* "value": "<random string>"
* }
*
*/
declare const check: CrawlerDriver.StepCheck;
export default check;