diff --git a/test/integration/api-test-cases.yaml b/test/integration/api-test-cases.yaml new file mode 100644 index 000000000..6feb19855 --- /dev/null +++ b/test/integration/api-test-cases.yaml @@ -0,0 +1,31 @@ +config: + inherit-env: true + +tests: + 001 - it successfully uses the api command to fetch tenant settings: + command: auth0 api get "tenants/settings" --query "include_fields=true" --query "fields=idle_session_lifetime" + exit-code: 0 + stdout: + contains: + - "idle_session_lifetime" + + 002 - it successfully uses the api command to patch tenant settings with piped data: + command: cat ./test/integration/fixtures/update-tenant-settings.json | auth0 api patch "tenants/settings" && auth0 api get "tenants/settings" --query "include_fields=true" --query "fields=idle_session_lifetime" + exit-code: 0 + stdout: + json: + idle_session_lifetime: "73" + + 003 - it successfully uses the api command to patch tenant settings: + command: auth0 api patch "tenants/settings" --data "{\"idle_session_lifetime\":72}" && auth0 api get "tenants/settings" --query "include_fields=true" --query "fields=idle_session_lifetime" + exit-code: 0 + stdout: + json: + idle_session_lifetime: "72" + + 004 - it fails to use the api command to patch tenant settings with invalid json: + command: auth0 api patch "tenants/settings" --data "{\"idle_session_lifetime:72}" + exit-code: 1 + stderr: + contains: + - "failed to parse command inputs: invalid json data given" diff --git a/test/integration/test-cases.yaml b/test/integration/test-cases.yaml index a38192e82..b27bf27b0 100644 --- a/test/integration/test-cases.yaml +++ b/test/integration/test-cases.yaml @@ -405,31 +405,6 @@ tests: - STAGE_PRE_USER_REGISTRATION_RATE exit-code: 0 - api get tenant settings: - command: auth0 api get "tenants/settings" - stdout: - json: - enabled_locales.#: "1" - exit-code: 0 - - api patch tenant settings with piped data: - command: cat ./test/integration/fixtures/update-tenant-settings.json | auth0 api patch "tenants/settings" - stdout: - json: - idle_session_lifetime: "73" - exit-code: 0 - - api patch tenant settings: - command: auth0 api patch "tenants/settings" --data "{\"idle_session_lifetime\":72}" - stdout: - json: - idle_session_lifetime: "72" - exit-code: 0 - - api patch tenant settings with wrong json: - command: auth0 api patch "tenants/settings" --data "{\"idle_session_lifetime:72}" - exit-code: 1 - create organization and check json output: command: auth0 orgs create --name integration-test-org-new --display "Integration Test Organization" --json --no-input exit-code: 0