// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Webhooks API Can create a webhook 1: [body] 1`] = ` Object { "webhooks": Array [ Object { "api_version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/, "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}/, "event": "test.create", "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, "integration_id": StringMatching /\\[a-f0-9\\]\\{24\\}/, "last_triggered_at": null, "last_triggered_error": null, "last_triggered_status": null, "name": "test", "secret": "thisissecret", "target_url": "http://example.com/webhooks/test/extra/1", "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}/, }, ], } `; exports[`Webhooks API Can create a webhook 2: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", "content-length": "392", "content-type": "application/json; charset=utf-8", "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, "vary": "Origin, Accept-Encoding", "x-powered-by": "Express", } `; exports[`Webhooks API Can delete a webhook 1: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, "vary": "Origin", "x-powered-by": "Express", } `; exports[`Webhooks API Can edit a webhook 1: [body] 1`] = ` Object { "webhooks": Array [ Object { "api_version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/, "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}/, "event": "subscriber.added", "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, "integration_id": StringMatching /\\[a-f0-9\\]\\{24\\}/, "last_triggered_at": null, "last_triggered_error": null, "last_triggered_status": null, "name": "Edit Test", "secret": "thisissecret", "target_url": "https://example.com/new-subscriber", "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}/, }, ], } `; exports[`Webhooks API Can edit a webhook 2: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", "content-length": "396", "content-type": "application/json; charset=utf-8", "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, "vary": "Origin, Accept-Encoding", "x-powered-by": "Express", } `; exports[`Webhooks API Fails nicely when adding a duplicate webhook 1: [body] 1`] = ` Object { "errors": Array [ Object { "code": null, "context": "Target URL has already been used for this event.", "details": null, "ghostErrorCode": null, "help": null, "id": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, "message": "Validation error, cannot save webhook.", "property": null, "type": "ValidationError", }, ], } `; exports[`Webhooks API Fails nicely when adding a duplicate webhook 2: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", "content-length": "272", "content-type": "application/json; charset=utf-8", "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, "vary": "Origin, Accept-Encoding", "x-powered-by": "Express", } `; exports[`Webhooks API Fails nicely when creating an orphaned webhook 1: [body] 1`] = ` Object { "errors": Array [ Object { "code": null, "context": "Validation failed for 'integration_id'. 'integration_id' value does not match any existing integration.", "details": null, "ghostErrorCode": null, "help": "Provide the 'integration_id' of an existing integration.", "id": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, "message": "Validation error, cannot save webhook.", "property": null, "type": "ValidationError", }, ], } `; exports[`Webhooks API Fails nicely when creating an orphaned webhook 2: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", "content-length": "381", "content-type": "application/json; charset=utf-8", "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, "vary": "Origin, Accept-Encoding", "x-powered-by": "Express", } `;