Skip to content

Commit

Permalink
specs: add cypress test for fallbackLanguages
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Jul 27, 2020
1 parent f87d9a5 commit 190de35
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cypress/fixtures/tpl/docs.index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
alias: {
'.*?/awesome':
'https://raw.githubusercontent.com/docsifyjs/awesome-docsify/master/README.md',
'.*?/changelog':
'/changelog':
'https://raw.githubusercontent.com/docsifyjs/docsify/master/CHANGELOG.md',
'/.*/_navbar.md': '/_navbar.md',
'/zh-cn/(.*)':
Expand All @@ -40,6 +40,7 @@
'/es/(.*)':
'https://raw.githubusercontent.com/docsifyjs/docs-es/master/$1'
},
fallbackLanguages: ['es'],
auto2top: true,
coverpage: true,
executeScript: true,
Expand Down
9 changes: 9 additions & 0 deletions cypress/integration/routing/fallback.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
context('config.fallbackLanguages', () => {
it('fallbacks respecting aliases', () => {
cy.visit('http://localhost:3000/#/es/');

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

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

0 comments on commit 190de35

Please sign in to comment.