chore: fix live-preview tests against prod (#9122)

Live preview e2e tests had no CSS when tested against prod.

For all our other tests, we have a separate test/app directory that
imports CSS. Otherwise, the root-level /app directory is used.

For live-preview, we currently always run against test/live-preview/app,
that has no CSS import.

This PR adds a new test/live-preview/prod/app directory that imports CSS
and is used when we run tests against prod.

In order for this to work, I had to make import map generation smarter
This commit is contained in:
Alessio Gravili
2024-11-11 19:28:55 -07:00
committed by GitHub
parent d8391389ab
commit 9c559d7304
99 changed files with 3873 additions and 14 deletions

View File

@@ -348,7 +348,8 @@ export function initPageConsoleErrorCatch(page: Page) {
!msg.text().includes('Error: NEXT_REDIRECT') &&
!msg.text().includes('Error getting document data') &&
!msg.text().includes('Failed trying to load default language strings') &&
!msg.text().includes('TypeError: Failed to fetch') // This happens when server actions are aborted
!msg.text().includes('TypeError: Failed to fetch') && // This happens when server actions are aborted
!msg.text().includes('der-radius: 2px Server Error: Error getting do') // This is a weird error that happens in the console
) {
// "Failed to fetch RSC payload for" happens seemingly randomly. There are lots of issues in the next.js repository for this. Causes e2e tests to fail and flake. Will ignore for now
// the the server responded with a status of error happens frequently. Will ignore it for now.