Skip to content

Commit 96ed371

Browse files
committed
fix intercept
1 parent 40f214e commit 96ed371

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

web/cypress/e2e/table/fields.spec.ts

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,19 @@
11
/// <reference types="cypress" />
2-
3-
import * as c from '../../support/const';
4-
import data from './../../../../mocks/loki/flow_records.json';
2+
import r from './../../../../mocks/loki/flow_records.json';
53

64
describe('netflow-table', () => {
7-
function reload(clearCache = true) {
5+
beforeEach(() => {
86
// this test bench only work with mocks
9-
cy.intercept('GET', c.url + '/api/loki/flow/records?*', (req) => {
10-
req.continue((res) => {
11-
res.body = data;
12-
})
7+
cy.intercept('GET', '/api/loki/flow/records?*', {
8+
statusCode: 200,
9+
body: r.data,
1310
});
14-
15-
cy.openNetflowTrafficPage(clearCache);
11+
cy.openNetflowTrafficPage(true);
1612

1713
//move to table view
1814
cy.get('.tableTabButton').click();
1915
//clear default app filters
20-
if (clearCache === true) {
21-
cy.get('#clear-all-filters-button').click();
22-
}
23-
}
24-
25-
beforeEach(() => {
26-
reload();
16+
cy.get('#clear-all-filters-button').click();
2717
});
2818

2919
it('display content correctly', () => {

0 commit comments

Comments
 (0)