Skip to content

Commit

Permalink
test(e2e): fix e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Jan 31, 2024
1 parent 1a12794 commit 0ca4546
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions e2e/tests/plugin-feed/feed.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ describe('feed', () => {

it('have json feed', () => {
cy.request(`${BASE}feed.json`).then((res) => {
const jsonFeed = JSON.parse(res.body)

expect(jsonFeed).to.be.a('object')
expect(jsonFeed).to.have.property(
expect(res.body).to.be.a('object')
expect(res.body).to.have.property(
'version',
'https://jsonfeed.org/version/1.1',
)
expect(res.body).to.contain('<strong>article excerpt</strong>')
expect(JSON.stringify(res.body)).to.contain(
'<strong>article excerpt</strong>',
)
})
})

Expand All @@ -43,11 +43,15 @@ describe('feed', () => {
expect(res.body).to.contain('Custom feed title')
expect(res.body).to.contain('Custom feed content.')
})

cy.request(`${BASE}feed.json`).then((res) => {
expect(res.body).to.contain('Custom feed title')
expect(res.body).to.contain('Custom feed description')
expect(res.body).to.contain('Custom feed content.')
const content = JSON.stringify(res.body)

expect(content).to.contain('Custom feed title')
expect(content).to.contain('Custom feed description')
expect(content).to.contain('Custom feed content.')
})

cy.request(`${BASE}rss.xml`).then((res) => {
expect(res.body).to.contain('Custom feed title')
expect(res.body).to.contain('Custom feed description')
Expand All @@ -59,9 +63,13 @@ describe('feed', () => {
cy.request(`${BASE}atom.xml`).then((res) => {
expect(res.body).to.not.contain('Excluded feed page content.')
})

cy.request(`${BASE}feed.json`).then((res) => {
expect(res.body).to.not.contain('Excluded feed page content.')
const content = JSON.stringify(res.body)

expect(content).to.not.contain('Excluded feed page content.')
})

cy.request(`${BASE}rss.xml`).then((res) => {
expect(res.body).to.not.contain('Excluded feed page content.')
})
Expand Down

0 comments on commit 0ca4546

Please sign in to comment.