mirror of
https://github.com/theoludwig/theoludwig.git
synced 2025-05-29 22:37:44 +02:00
feat: rewrite to Next.js v13 app directory
Improvements: - Hide switch theme input (ugly little white square) - i18n without subpath (e.g: /fr or /en), same url whatever the locale used
This commit is contained in:
@ -37,24 +37,24 @@ describe('Common > Header', () => {
|
||||
})
|
||||
|
||||
describe('Switch Language', () => {
|
||||
it('should switch language from EN (default) to FR', () => {
|
||||
it('should switch locale from EN (default) to FR', () => {
|
||||
cy.get('h1').contains('Théo LUDWIG')
|
||||
cy.get('[data-cy=language-flag-text]').contains('EN')
|
||||
cy.get('[data-cy=languages-list]').should('not.be.visible')
|
||||
cy.get('[data-cy=language-click]').click()
|
||||
cy.get('[data-cy=languages-list]').should('be.visible')
|
||||
cy.get('[data-cy=languages-list] > li:first-child').contains('FR').click()
|
||||
cy.get('[data-cy=languages-list]').should('not.be.visible')
|
||||
cy.get('[data-cy=language-flag-text]').contains('FR')
|
||||
cy.get('[data-cy=locale-flag-text]').contains('EN')
|
||||
cy.get('[data-cy=locales-list]').should('not.be.visible')
|
||||
cy.get('[data-cy=locale-click]').click()
|
||||
cy.get('[data-cy=locales-list]').should('be.visible')
|
||||
cy.get('[data-cy=locales-list] > li:first-child').contains('FR').click()
|
||||
cy.get('[data-cy=locales-list]').should('not.be.visible')
|
||||
cy.get('[data-cy=locale-flag-text]').contains('FR')
|
||||
cy.get('h1').contains('Théo LUDWIG')
|
||||
})
|
||||
|
||||
it('should close the language list menu when clicking outside', () => {
|
||||
cy.get('[data-cy=languages-list]').should('not.be.visible')
|
||||
cy.get('[data-cy=language-click]').click()
|
||||
cy.get('[data-cy=languages-list]').should('be.visible')
|
||||
it('should close the locale list menu when clicking outside', () => {
|
||||
cy.get('[data-cy=locales-list]').should('not.be.visible')
|
||||
cy.get('[data-cy=locale-click]').click()
|
||||
cy.get('[data-cy=locales-list]').should('be.visible')
|
||||
cy.get('h1').click()
|
||||
cy.get('[data-cy=languages-list]').should('not.be.visible')
|
||||
cy.get('[data-cy=locales-list]').should('not.be.visible')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -1,7 +1,7 @@
|
||||
describe('Page /blog/[slug]', () => {
|
||||
it('should displays the first blog post (`hello-world`)', () => {
|
||||
cy.visit('/blog/hello-world')
|
||||
cy.get('[data-cy=language-flag-text]').should('not.exist')
|
||||
cy.get('[data-cy=locale-flag-text]').should('not.exist')
|
||||
cy.get('h1').should('have.text', '👋 Hello, world!')
|
||||
cy.get('.prose a:visible').should('have.attr', 'target', '_blank')
|
||||
})
|
||||
|
Reference in New Issue
Block a user