Skip to content

Commit 40f214e

Browse files
committed
force mocks data
1 parent 75bb999 commit 40f214e

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

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

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
/// <reference types="cypress" />
22

33
import * as c from '../../support/const';
4-
5-
let useMocks = false
4+
import data from './../../../../mocks/loki/flow_records.json';
65

76
describe('netflow-table', () => {
87
function reload(clearCache = true) {
9-
cy.intercept({
10-
method: 'GET',
11-
url: c.url + '/api/frontend-config',
12-
}).as('frontend-config')
8+
// 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+
})
13+
});
1314

1415
cy.openNetflowTrafficPage(clearCache);
1516

16-
cy.wait('@frontend-config').then((interception) => {
17-
useMocks = interception?.response.body.lokiMocks || false;
18-
})
19-
2017
//move to table view
2118
cy.get('.tableTabButton').click();
2219
//clear default app filters
@@ -30,11 +27,6 @@ describe('netflow-table', () => {
3027
});
3128

3229
it('display content correctly', () => {
33-
if (!useMocks) {
34-
it.skip("Skipping test since not using mocks");
35-
return
36-
}
37-
3830
// select first row
3931
cy.get('#netflow-table-row-0').click()
4032
// check for side panel content

0 commit comments

Comments
 (0)