Skip to content

Commit 4c565a9

Browse files
committed
test(ssg): add check for body element in redirect HTML
1 parent 419eb31 commit 4c565a9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/helper/ssg/ssg.test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ describe('toSSG function', () => {
280280
expect(content).toContain('<meta name="robots" content="noindex" />')
281281
// Should contain link anchor
282282
expect(content).toContain('<a href="/new">Redirecting from')
283+
// Should contain a body element that includes the anchor
284+
expect(content).toMatch(/<body[^>]*>[\s\S]*<a href=\"\/new\">[\s\S]*<\/body>/)
283285
})
284286

285287
it('should skip generating a redirect HTML when 301/302 has no Location header', async () => {

0 commit comments

Comments
 (0)