Skip to content

Commit

Permalink
Add additional tests for index file hosting
Browse files Browse the repository at this point in the history
  • Loading branch information
rgladwell committed Oct 8, 2020
1 parent f940526 commit 6070ce1
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions cypress/integration/routing/index-file.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,33 @@ context('routing.indexFile', () => {

cy.get('#main').should('contain', 'Bug Fixes');
})

it('handles index file routing with fragments', () => {
cy.visit('http://localhost:3000/index.html#/');

cy.get('.sidebar-nav').contains('Changelog').click();

cy.get('#main').should('contain', 'Bug Fixes');
})

it('returns 404 for index file with leading fragment', () => {
cy.visit('http://localhost:3000/#/index.html/');

cy.get('#main').should('contain', '404');
})

it('returns 500 for index file as folder', () => {
cy.request({
url: 'http://localhost:3000/index.html/#/',
failOnStatusCode: false
}).then((resp) => expect(500).to.eq(resp.status))
})


it('does not serve shadowing index markdown file', () => {
cy.request({
url: 'http://localhost:3000/index.md',
failOnStatusCode: false
}).then((resp) => expect(404).to.eq(resp.status))
})
});

0 comments on commit 6070ce1

Please sign in to comment.