Extract admin dashboard from ghabilee-frontend2 into a dedicated Next.js app for backoffice.ghabilee.ir (no SEO indexing / Clarity).
34 lines
1.4 KiB
TypeScript
34 lines
1.4 KiB
TypeScript
import { createRequire } from 'node:module'
|
|
|
|
import { describe, expect, it } from 'vitest'
|
|
|
|
const require = createRequire(import.meta.url)
|
|
const nextConfig = require('../../next.config.js') as {
|
|
redirects: () => Promise<{ source: string; destination: string; permanent: boolean }[]>
|
|
}
|
|
|
|
describe('legacy SEO redirects', () => {
|
|
it('permanently migrates the high-value URLs found in Search Console', async () => {
|
|
const redirects = await nextConfig.redirects()
|
|
|
|
expect(redirects).toEqual(
|
|
expect.arrayContaining([
|
|
expect.objectContaining({ source: '/karagah-ravanshenasi', destination: '/category/learning-experience', permanent: true }),
|
|
expect.objectContaining({ source: '/varzesh-goroohi', destination: '/category/sports-adventure', permanent: true }),
|
|
expect.objectContaining({
|
|
source: '/blogs/goroohhaye-piyaderoyi-iran',
|
|
destination: '/blog/hiking-outdoor-group-guide',
|
|
permanent: true,
|
|
}),
|
|
expect.objectContaining({ source: '/blogs', destination: '/blog', permanent: true }),
|
|
expect.objectContaining({ source: '/city/thran', destination: '/city/tehran', permanent: true }),
|
|
expect.objectContaining({
|
|
source: '/category/:categorySlug/city/mshd',
|
|
destination: '/category/:categorySlug/city/mashhad',
|
|
permanent: true,
|
|
}),
|
|
])
|
|
)
|
|
})
|
|
})
|