diff --git a/cypress/integration/routing/index-file.spec.js b/cypress/integration/routing/index-file.spec.js index bddf9cbce..3aeb0438f 100644 --- a/cypress/integration/routing/index-file.spec.js +++ b/cypress/integration/routing/index-file.spec.js @@ -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)) + }) });