Skip to content

Commit 5e66d67

Browse files
committed
Adds test for dashboard endpoints
1 parent 79d28f0 commit 5e66d67

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

docker/docker-compose.ci.mysql.yml

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ services:
1818
MYSQL_DATABASE: 'npm'
1919
MYSQL_USER: 'npm'
2020
MYSQL_PASSWORD: 'npmpass'
21+
MARIADB_AUTO_UPGRADE: '1'
2122
volumes:
2223
- mysql_vol:/var/lib/mysql
2324
networks:

test/cypress/e2e/api/Dashboard.cy.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/// <reference types="cypress" />
2+
3+
describe('Dashboard endpoints', () => {
4+
let token;
5+
6+
before(() => {
7+
cy.getToken().then((tok) => {
8+
token = tok;
9+
});
10+
});
11+
12+
it('Should be able to get host counts', function() {
13+
cy.task('backendApiGet', {
14+
token: token,
15+
path: '/api/reports/hosts'
16+
}).then((data) => {
17+
cy.validateSwaggerSchema('get', 200, '/reports/hosts', data);
18+
expect(data).to.have.property('dead');
19+
expect(data).to.have.property('proxy');
20+
expect(data).to.have.property('redirection');
21+
expect(data).to.have.property('stream');
22+
});
23+
});
24+
25+
});

0 commit comments

Comments
 (0)