Skip to content

Commit dd04c72

Browse files
committed
test: improve redirect testsuite
1 parent 3960416 commit dd04c72

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

src/test/cypress/integration/redirect_spec.cy.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,26 @@
33

44
context('Visiting a legacy URL', () => {
55
it('redirects to the new index route', () => {
6-
cy.visit('index.html?action=search&type=name&q=tei')
7-
cy.url().should('equal', 'http://localhost:8080/exist/apps/fundocs/?action=search&where=everywhere&q=tei')
6+
cy.visit('index.html', { qs: { action: 'search', type: 'name', q: 'tei'}})
7+
8+
cy.location('pathname').should('eq', '/exist/apps/fundocs/')
9+
cy.location('search').should('include', 'action=search')
10+
cy.location('search').should('include', 'where=everywhere')
11+
cy.location('search').should('include', 'q=tei')
812
})
913
it('redirects to the new view route', () => {
10-
cy.visit('view.html?uri=http://exist-db.org/xquery/file&function=file:sync&arity=3&location=java:org.exist.xquery.modules.file.FileModule')
11-
cy.url().should('equal', 'http://localhost:8080/exist/apps/fundocs/view?location=java%3Aorg.exist.xquery.modules.file.FileModule&uri=http%3A%2F%2Fexist-db.org%2Fxquery%2Ffile&function=file%3Async')
14+
cy.visit('view.html', { qs: { uri: 'http://exist-db.org/xquery/file', function: 'file:sync', location: 'java:org.exist.xquery.modules.file.FileModule'}})
15+
16+
cy.location('pathname').should('eq', '/exist/apps/fundocs/view')
17+
cy.location('search').should('include', 'uri=http%3A%2F%2Fexist-db.org%2Fxquery%2Ffile')
18+
cy.location('search').should('include', 'function=file%3Async')
19+
cy.location('search').should('include', 'location=java%3Aorg.exist.xquery.modules.file.FileModule')
1220
})
1321
it('redirects to the new browse URL', () => {
14-
cy.visit('browse.html?w3c=true&appmodules=true')
15-
cy.url().should('equal', 'http://localhost:8080/exist/apps/fundocs/browse?w3c=true&appmodules=true')
22+
cy.visit('browse.html', { qs: { w3c: 'true', appmodules: 'true'}})
23+
24+
cy.location('pathname').should('eq', '/exist/apps/fundocs/browse')
25+
cy.location('search').should('include', 'w3c=true')
26+
cy.location('search').should('include', 'appmodules=true')
1627
})
1728
})

0 commit comments

Comments
 (0)