Skip to content

Commit

Permalink
chore(deps): manually update all non-major dependencies (nuxt-modules…
Browse files Browse the repository at this point in the history
…#1267)

Nuxt changed some handling related to trailing spaces so tests needed
to be updated. I don't see the new behavior either better or worse (maybe
a bit better as it will cause less URL changes) so just updating the tests.
  • Loading branch information
rchl authored Aug 24, 2021
1 parent 56869b1 commit f04fb6c
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 190 deletions.
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"dev:basic": "nuxt -c ./test/fixture/basic/nuxt.config.js",
"dev:basic:generate": "nuxt generate -c ./test/fixture/basic/nuxt.config.js",
"dev:basic:start": "nuxt start -c ./test/fixture/basic/nuxt.config.js",
"start:dist": "jiti ./test/utils/http-server-internal.js --port 8080 -v dist --base /nuxt/",
"start:dist": "jiti ./test/utils/http-server-internal.js --port 8080 -v dist",
"coverage": "codecov",
"lint": "eslint --ext .js,.vue,.ts src test types && tsc",
"test": "yarn test:types && yarn test:unit && yarn test:e2e-ssr && yarn test:e2e-browser",
Expand Down Expand Up @@ -97,22 +97,22 @@
"js-cookie": "^3.0.0",
"klona": "^2.0.4",
"lodash.merge": "^4.6.2",
"ufo": "^0.7.7",
"ufo": "^0.7.9",
"vue-i18n": "^8.25.0"
},
"devDependencies": {
"@babel/core": "7.15.0",
"@babel/preset-env": "7.15.0",
"@babel/runtime": "7.15.3",
"@nuxt/types": "2.15.7",
"@nuxtjs/composition-api": "0.26.0",
"@nuxt/types": "2.15.8",
"@nuxtjs/composition-api": "0.27.0",
"@nuxtjs/eslint-config-typescript": "6.0.1",
"@nuxtjs/module-test-utils": "1.6.3",
"@release-it/conventional-changelog": "3.1.0",
"@release-it/conventional-changelog": "3.3.0",
"@types/argparse": "2.0.10",
"@types/cookie": "0.4.1",
"@types/express": "4.17.13",
"@types/jest": "27.0.0",
"@types/jest": "27.0.1",
"@types/jest-dev-server": "4.2.1",
"@types/js-cookie": "2.2.7",
"@types/jsdom": "16.2.13",
Expand All @@ -123,17 +123,17 @@
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.1.0",
"codecov": "3.8.3",
"core-js": "3.16.1",
"core-js": "3.16.2",
"eslint": "7.32.0",
"express": "4.17.1",
"husky": "4.3.8",
"jest": "27.0.6",
"jest-dev-server": "5.0.3",
"jsdom": "16.7.0",
"messageformat": "2.3.0",
"nuxt": "2.15.7",
"playwright-chromium": "1.13.1",
"release-it": "14.11.3",
"nuxt": "2.15.8",
"playwright-chromium": "1.14.0",
"release-it": "14.11.5",
"serve-static": "1.14.1",
"typescript": "^4.3.5"
}
Expand Down
13 changes: 6 additions & 7 deletions test/browser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ describe(`${browserString} (generate, with router base) + redirectOn is root`, (
page = await browser.newPage({ locale: 'fr' })
await page.goto(server.getUrl('/'))
// Trailing slash added by the server.
expect(page.url()).toBe(server.getUrl('/fr'))
expect(page.url()).toBe(server.getUrl('/fr/'))
// Need to delay a bit due to vue-meta batching with 10ms timeout.
await page.waitForTimeout(20)
expect(await page.title()).toBe('Accueil')
Expand Down Expand Up @@ -362,7 +362,7 @@ describe(`${browserString} (generate, with router base) + redirectOn is all`, ()
page = await browser.newPage({ locale: 'fr' })
await page.goto(server.getUrl('/'))
// Trailing slash added by the server.
expect(page.url()).toBe(server.getUrl('/fr'))
expect(page.url()).toBe(server.getUrl('/fr/'))
// Need to delay a bit due to vue-meta batching with 10ms timeout.
await page.waitForTimeout(20)
expect(await page.title()).toBe('Accueil')
Expand Down Expand Up @@ -602,11 +602,11 @@ for (const target of ['server', 'static']) {
test('redirects to saved locale on re-visiting the root path', async () => {
page = await browser.newPage()
await page.goto(server.getUrl('/fr'))
expect(page.url()).toBe(server.getUrl('/fr'))
expect(page.url()).toBe(server.getUrl('/fr/'))
expect(await (await page.$('body'))?.textContent()).toContain('locale: fr')

await page.goto(server.getUrl('/'))
expect(page.url()).toBe(server.getUrl('/fr'))
expect(page.url()).toBe(server.getUrl('/fr/'))
expect(await (await page.$('body'))?.textContent()).toContain('locale: fr')
})
})
Expand Down Expand Up @@ -659,7 +659,7 @@ describe(`${browserString} (generate with detectBrowserLanguage.fallbackLocale)`
test('redirects to browser locale', async () => {
page = await browser.newPage({ locale: 'fr' })
await page.goto(server.getUrl('/'))
expect(page.url()).toBe(server.getUrl('/fr'))
expect(page.url()).toBe(server.getUrl('/fr/'))
expect(await (await page.$('body'))?.textContent()).toContain('locale: fr')
})
})
Expand Down Expand Up @@ -1271,8 +1271,7 @@ describe(`${browserString} (redirectOn is root + prefix_except_default)`, () =>
const page = await browser.newPage({ locale: 'en' })
await page.goto(url('/fr/'))
expect(await (await page.$('#current-page'))?.textContent()).toContain('page: Accueil')
// Nuxt implicitly normalizes the trailing slash on initial reloading by calling router.replace(route).
expect(await getRouteFullPath(page)).toBe('/fr')
expect(await getRouteFullPath(page)).toBe('/fr/')
})

test('does not detect locale and redirect on prefixed, non-root path', async () => {
Expand Down
Loading

0 comments on commit f04fb6c

Please sign in to comment.