2022-05-05 03:02:50 +00:00
|
|
|
const { getRequest } = require( '../../utils/request' );
|
2021-08-23 17:39:03 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Tests to verify connection to the API.
|
|
|
|
*
|
|
|
|
* @group hello
|
|
|
|
*
|
|
|
|
*/
|
2022-05-05 03:02:50 +00:00
|
|
|
describe( 'Test API connectivity', () => {
|
|
|
|
it( 'can access a non-authenticated endpoint', async () => {
|
2021-08-23 17:39:03 +00:00
|
|
|
const result = await getRequest( '' );
|
2021-08-23 20:51:33 +00:00
|
|
|
expect( result.statusCode ).toEqual( 200 );
|
2022-05-05 03:02:50 +00:00
|
|
|
} );
|
2021-08-23 17:39:03 +00:00
|
|
|
|
2022-05-05 03:02:50 +00:00
|
|
|
it( 'can access an authenticated endpoint', async () => {
|
2021-08-23 17:39:03 +00:00
|
|
|
const result = await getRequest( 'system_status' );
|
2021-08-23 20:51:33 +00:00
|
|
|
expect( result.statusCode ).toEqual( 200 );
|
2022-05-05 03:02:50 +00:00
|
|
|
} );
|
|
|
|
} );
|