1
1
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:
2023-07-31 19:06:46 +02:00
parent 5640f1b434
commit 6b29ce9b15
61 changed files with 755 additions and 787 deletions

View File

@ -1,16 +0,0 @@
import { Footer } from '@/components/Footer'
describe('<Footer />', () => {
it('should render with appropriate link tag version', () => {
const version = '1.0.0'
cy.mount(<Footer version={version} />)
cy.contains('Théo LUDWIG')
.get('[data-cy=version-link]')
.should('have.text', version)
.should(
'have.attr',
'href',
`https://github.com/theoludwig/theoludwig/releases/tag/v${version}`
)
})
})

View File

@ -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')
})
})
})

View File

@ -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')
})