Skip to content

Commit

Permalink
test simple only
Browse files Browse the repository at this point in the history
  • Loading branch information
adrai committed Apr 15, 2024
1 parent 0736495 commit 4a852c4
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 28 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 15.3.0

- Only overwrite ns config if it provided [#2270](https://github.com/i18next/next-i18next/pull/2270)

## 15.2.0

- add possibility to pass resources directly via config and set localePath to null
Expand Down
54 changes: 27 additions & 27 deletions cypress/e2e/spec.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ describe('basic e2e test run', () => {
cy.contains('Back to home').click()
cy.location('pathname', { timeout: 10000 }).should('equal', '/')
cy.contains('A simple example')
cy.contains('To auto static page (en)').click()
cy.location('pathname', { timeout: 10000 }).should(
'equal',
'/auto-static'
)
cy.contains('hello_en')
cy.contains('Back to home').click()
cy.location('pathname', { timeout: 10000 }).should('equal', '/')
cy.contains('A simple example')
// cy.contains('To auto static page (en)').click()
// cy.location('pathname', { timeout: 10000 }).should(
// 'equal',
// '/auto-static'
// )
// cy.contains('hello_en')
// cy.contains('Back to home').click()
// cy.location('pathname', { timeout: 10000 }).should('equal', '/')
// cy.contains('A simple example')

// Test German content
cy.contains('Change locale').click()
Expand All @@ -42,28 +42,28 @@ describe('basic e2e test run', () => {
'/de'
)
cy.contains('Ein einfaches Beispiel')
cy.contains('To auto static page (de)').click()
cy.location('pathname', { timeout: 10000 }).should(
'equal',
'/de/auto-static'
)
cy.contains('hello_de')
cy.contains('Zurück zur Hauptseite').click()
cy.location('pathname', { timeout: 10000 }).should(
'equal',
'/de'
)
cy.contains('Ein einfaches Beispiel')
// cy.contains('To auto static page (de)').click()
// cy.location('pathname', { timeout: 10000 }).should(
// 'equal',
// '/de/auto-static'
// )
// cy.contains('hello_de')
// cy.contains('Zurück zur Hauptseite').click()
// cy.location('pathname', { timeout: 10000 }).should(
// 'equal',
// '/de'
// )
// cy.contains('Ein einfaches Beispiel')
cy.contains('Sprache wechseln zu').click()
cy.location('pathname', { timeout: 10000 }).should('equal', '/')
cy.contains('A simple example')

// Test generated version of auto static
cy.request('/auto-static')
.its('body')
.should('include', '<h2>hello_en</h2>')
cy.request('/de/auto-static')
.its('body')
.should('include', '<h2>hello_de</h2>')
// cy.request('/auto-static')
// .its('body')
// .should('include', '<h2>hello_en</h2>')
// cy.request('/de/auto-static')
// .its('body')
// .should('include', '<h2>hello_de</h2>')
})
})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"install:example:auto-static-optimize": "cd examples/auto-static-optimize && npm install",
"move-build-to-examples?": "Hack: see # @link https://github.com/i18next/next-i18next/pull/2012",
"move-build-to-examples": "rimraf ./examples/*/node_modules/next-i18next && cpy './package.json' './*.js' './*.ts' './dist' ./examples/simple/node_modules/next-i18next && cpy './package.json' './*.js' './*.ts' './dist' ./examples/ssg/node_modules/next-i18next && cpy './package.json' './*.js' './*.ts' './dist' ./examples/auto-static-optimize/node_modules/next-i18next ",
"test:e2e": "start-server-and-test 'cd examples/auto-static-optimize && npm run start' http://127.0.0.1:3000 cy:run",
"test:e2e": "start-server-and-test 'cd examples/simple && npm run start' http://127.0.0.1:3000 cy:run",
"cy:run": "cypress run",
"example": "npm run example:simple",
"example:prod": "npm run example:simple:prod",
Expand Down

0 comments on commit 4a852c4

Please sign in to comment.