Hey, I need to send a post request to an API and get a response body to validate it.
There is almost no material online related to this. Can someone please help me out with this problem?
This is the cypress code snippet
cy.intercept('POST', '/myapi/admin/getIntegrations').as('searchResult')
cy.wait('@searchResult', { requestTimeout: 30000 }).then(i => {
cy.get('td.mat-column-request > button').eq(0).click()
cy.get('.mat-dialog-content > * p').invoke('text').then(req => {
req = JSON.parse(req)
expect(req).to.have.property('event', "course.created")
expect(req.data[0].course).to.have.property('employeeId', employeeId)
expect(req.data[0].course).to.have.property('courseName', courseName)
expect(req.data[0].course).to.have.property('createdBy', 'abcd')
expect(req.data[0].course).to.have.property('status', 'In Progress')
expect(req.data[0].course).to.have.property('enabled', 1)
})