/
githubmirror
/
joomla-cms
Обзор
Документация
Войти
/
githubmirror
/
joomla-cms
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
5.4-dev
tests/System/integration/api/Basic.cy.js
20 строк
859 B
Nicola Galgano
wrong route (#45133)
15 мар 2025, 09:19
Не верифицирован
15 мар 2025, 09:19
f81fe78
Код
Авторство
О чём код?
describe('Test that the API', () => { it('returns unauthorized return code when a malformed token is set', () => { cy.request({ method: 'GET', url: '/api/index.php/v1/content/articles', headers: { Authorization: 'Bearer 123' }, failOnStatusCode: false, }) .its('status').should('equal', 401); }); it('returns unauthorized return code when no token is set', () => { cy.request({ method: 'GET', url: '/api/index.php/v1/content/articles', failOnStatusCode: false }) .its('status').should('equal', 401); }); it('returns not found return code when wrong route is set', () => { cy.api_getBearerToken().then((token) => cy.request({ method: 'GET', url: '/api/index.php/v1/invalid', headers: { Authorization: `Bearer ${token}` }, failOnStatusCode: false, }) .its('status').should('equal', 404)); }); });