Skip to content

Commit 6070ce1

Browse files
committed
Add additional tests for index file hosting
1 parent f940526 commit 6070ce1

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

cypress/integration/routing/index-file.spec.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,33 @@ context('routing.indexFile', () => {
66

77
cy.get('#main').should('contain', 'Bug Fixes');
88
})
9+
10+
it('handles index file routing with fragments', () => {
11+
cy.visit('http://localhost:3000/index.html#/');
12+
13+
cy.get('.sidebar-nav').contains('Changelog').click();
14+
15+
cy.get('#main').should('contain', 'Bug Fixes');
16+
})
17+
18+
it('returns 404 for index file with leading fragment', () => {
19+
cy.visit('http://localhost:3000/#/index.html/');
20+
21+
cy.get('#main').should('contain', '404');
22+
})
23+
24+
it('returns 500 for index file as folder', () => {
25+
cy.request({
26+
url: 'http://localhost:3000/index.html/#/',
27+
failOnStatusCode: false
28+
}).then((resp) => expect(500).to.eq(resp.status))
29+
})
30+
31+
32+
it('does not serve shadowing index markdown file', () => {
33+
cy.request({
34+
url: 'http://localhost:3000/index.md',
35+
failOnStatusCode: false
36+
}).then((resp) => expect(404).to.eq(resp.status))
37+
})
938
});

0 commit comments

Comments
 (0)