Skip to content

Commit

Permalink
Add tests for news and communications page
Browse files Browse the repository at this point in the history
  • Loading branch information
hannalaakso authored and NickColley committed Apr 29, 2019
1 parent 9f67609 commit 0e0f6bd
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions app/full-page-examples.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,33 @@ describe(`http://localhost:${PORT}/full-page-examples/`, () => {
})
})

describe('news-and-communications', () => {
it('should show most wanted results by default', (done) => {
requestPath.get('news-and-communications', (err, res) => {
let $ = cheerio.load(res.body)
// Check the results are correct
expect($.html()).toContain('822,411 results')
done(err)
})
})
it('should show sorted results when selected', (done) => {
requestPath.get('news-and-communications?order=updated-newest', (err, res) => {
let $ = cheerio.load(res.body)
// Check the results are correct
expect($.html()).toContain('142,218 results')
done(err)
})
})
it('should show organisation results when selected', (done) => {
requestPath.get('news-and-communications?order=updated-newest&organisation=hmrc', (err, res) => {
let $ = cheerio.load(res.body)
// Check the results are correct
expect($.html()).toContain('421,182 results')
done(err)
})
})
})

describe('what-was-the-last-country-you-visited', () => {
it('should not show errors if submit with no input', (done) => {
requestPath.get('what-was-the-last-country-you-visited', (err, res) => {
Expand Down

0 comments on commit 0e0f6bd

Please sign in to comment.