Skip to content

Commit

Permalink
break cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed Nov 12, 2023
1 parent 42b11c5 commit c5177a0
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions cypress/e2e/session-recording.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ describe('Session recording', () => {
sessionRecording: {
endpoint: '/ses/',
},
supportedCompression: ['gzip', 'lz64'],
supportedCompression: ['None'],
capture_performance: true,
},
}).as('decide')

Expand All @@ -32,8 +33,21 @@ describe('Session recording', () => {
.type('hello posthog!')
.wait('@session-recording')
.then(() => {
const requests = cy.state('requests').filter(({ alias }) => alias === 'session-recording')
expect(requests.length).to.be.above(0).and.to.be.below(2)
cy.phCaptures({ full: true }).then((captures) => {
// should be a pageview and a $snapshot
expect(captures.map((c) => c.event)).to.deep.equal(['$pageview', '$snapshot'])
// the snapshot should have a meta and a full snapshot (and nothing else?)
expect(captures[1]['properties']['$snapshot_data']).to.have.length(37)
expect(
JSON.stringify(captures[1]['properties']['$snapshot_data'].map((c) => c.type))
).to.deep.equal(['wat'])
expect(captures[1]['properties']['$snapshot_data']).to.have.length(2)
})
// const requests = cy.state('requests').filter(({ alias }) => alias === 'session-recording')
// const request = requests[0]
// expect(JSON.stringify(Object.keys(request))).to.eq([])
// const requestBody = JSON.parse(request.text().substring(5))
// expect(requestBody).to.eql([{}])
})
})
})
Expand All @@ -52,6 +66,7 @@ describe('Session recording', () => {
endpoint: '/ses/',
},
supportedCompression: ['gzip', 'lz64'],
capture_performance: true,
},
}).as('decide')

Expand Down

0 comments on commit c5177a0

Please sign in to comment.