Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed May 5, 2023
1 parent 1757f8a commit 85a20c4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
12 changes: 6 additions & 6 deletions test/e2e/app-dir/app/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ createNextDescribe(
})
}

it('should serve from pages with latest react', async () => {
const $ = await next.render$('/')
expect($('#hello').text()).toBe('hello from pages/index')
expect($('#react-version').text()).toBe('18.2.0')
})

if (isNextStart) {
it('should generate build traces correctly', async () => {
const trace = JSON.parse(
Expand Down Expand Up @@ -264,12 +270,6 @@ createNextDescribe(
expect($('title').first().text()).toBe('hello world')
})

it('should serve from pages with latest react', async () => {
const $ = await next.render$('/')
expect($('#hello').text()).toBe('hello from pages/index')
expect($('#react-version').text()).toBe('18.2.0')
})

it('should serve dynamic route from pages', async () => {
const html = await next.render('/blog/first')
expect(html).toContain('hello from pages/blog/[slug]')
Expand Down
6 changes: 4 additions & 2 deletions test/e2e/app-dir/metadata-dynamic-routes/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,12 @@ createNextDescribe(
})

it('should support generate multi sitemaps with generateSitemaps', async () => {
const ids = [0, 1, 2, 3]
const ids = [0, 1, 2]
function fetchSitemap(id) {
return next
.fetch(`/dynamic/small/sitemap.xml/${id}`)
.fetch(
isNextDev ? `/gsp/sitemap.xml/${id}` : `/gsp/sitemap/${id}.xml`
)
.then((res) => res.text())
}

Expand Down

0 comments on commit 85a20c4

Please sign in to comment.