Skip to content

Commit

Permalink
add basic reports test
Browse files Browse the repository at this point in the history
  • Loading branch information
tevko committed Nov 17, 2024
1 parent 6aeb297 commit 67d430a
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion e2e/cypress/e2e/client-admin/reports.cy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
describe('Reports', function () {
beforeEach(function () {
// Disable matrix functionality to avoid assertExists errors
cy.intercept('GET', '/api/v3/math/pca2*', {
statusCode: 200,
body: {
'base-clusters': [],
consensus: {},
'group-aware-consensus': {},
'group-clusters': [],
'group-votes': [],
'n-cmts': 0,
'user-vote-counts': [],
'votes-base': [],
center: [],
'comment-extremity': [],
'comment-projection': [],
comps: [],
repness: [],
tids: [],
pca: {
center: [],
'comment-extremity': [],
'comment-projection': [],
comps: [],
},
}, // or minimal math data structure if needed
}).as('getMath')
cy.intercept('GET', '/api/v3/conversations*').as('getConversations')
cy.intercept('GET', '/api/v3/reports*').as('getReports')
cy.intercept('GET', '/api/v3/comments*').as('getComments')
Expand All @@ -16,7 +42,10 @@ describe('Reports', function () {
// pause for ten seconds to allow the button to be visible
cy.pause()
cy.contains('button', 'Create report url').click()
cy.get('a').should('exist')
cy.get('a[href*="/report/"]').then(($link) => {
cy.visit($link.attr('href'))
cy.get('[data-testid="reports-overview"]').should('exist')
})
})
})
})

0 comments on commit 67d430a

Please sign in to comment.