Unverified Commit 51d97c8b authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

test: allow query suffix in related media URL e2e assertions (#89872)

## Summary
- apply the same deploy query-suffix tolerance (`(?:\?.*)?`) to related
e2e background-image URL assertions
- update SCSS URL tests (`url-global-partial`,
`url-global-asset-prefix-1`, `url-global-asset-prefix-2`) and
`url-imports` CSS background-image assertion

## Context
- follow-up to #89856, which applied this fix to `url-global`

## Verification
- regex sanity checks with and without query suffixes passed
- attempted local `testonly` run for `url-imports`, but local
Turbopack+urlImports limitations caused unrelated failures
parent b6cf46a8
...@@ -34,7 +34,7 @@ describe.skip('SCSS Support loader handling', () => { ...@@ -34,7 +34,7 @@ describe.skip('SCSS Support loader handling', () => {
.elementByCss('.red-text') .elementByCss('.red-text')
.getComputedCss('background-image') .getComputedCss('background-image')
expect(background).toMatch( expect(background).toMatch(
/url\(".*\/foo\/_next\/static\/media\/dark\..*\.svg"\), url\(".*\/foo\/_next\/static\/media\/dark2\..*\.svg"\)/ /url\(".*\/foo\/_next\/static\/media\/dark\..*\.svg(?:\?.*)?"\), url\(".*\/foo\/_next\/static\/media\/dark2\..*\.svg(?:\?.*)?"\)/
) )
const urls = getUrlFromBackgroundImage(background) const urls = getUrlFromBackgroundImage(background)
......
...@@ -34,7 +34,7 @@ describe.skip('SCSS Support loader handling', () => { ...@@ -34,7 +34,7 @@ describe.skip('SCSS Support loader handling', () => {
.elementByCss('.red-text') .elementByCss('.red-text')
.getComputedCss('background-image') .getComputedCss('background-image')
expect(background).toMatch( expect(background).toMatch(
/url\(".*\/foo\/_next\/static\/media\/dark\..*\.svg"\), url\(".*\/foo\/_next\/static\/media\/dark2\..*\.svg"\)/ /url\(".*\/foo\/_next\/static\/media\/dark\..*\.svg(?:\?.*)?"\), url\(".*\/foo\/_next\/static\/media\/dark2\..*\.svg(?:\?.*)?"\)/
) )
const urls = getUrlFromBackgroundImage(background) const urls = getUrlFromBackgroundImage(background)
......
...@@ -33,7 +33,7 @@ describe('SCSS Support loader handling', () => { ...@@ -33,7 +33,7 @@ describe('SCSS Support loader handling', () => {
.elementByCss('.red-text') .elementByCss('.red-text')
.getComputedCss('background-image') .getComputedCss('background-image')
expect(background).toMatch( expect(background).toMatch(
/url\(".*\/_next\/static\/media\/darka\..*\.svg"\), url\(".*\/_next\/static\/media\/darkb\..*\.svg"\)/ /url\(".*\/_next\/static\/media\/darka\..*\.svg(?:\?.*)?"\), url\(".*\/_next\/static\/media\/darkb\..*\.svg(?:\?.*)?"\)/
) )
const urls = getUrlFromBackgroundImage(background) const urls = getUrlFromBackgroundImage(background)
......
...@@ -84,7 +84,7 @@ import { join } from 'path' ...@@ -84,7 +84,7 @@ import { join } from 'path'
.elementByCss('#static-css') .elementByCss('#static-css')
.getComputedCss('background-image') .getComputedCss('background-image')
).toMatch( ).toMatch(
/^url\("http(s)?:\/\/.+\/_next\/static\/media\/vercel\.[0-9a-f]{8}\.png"\)$/ /^url\("http(s)?:\/\/.+\/_next\/static\/media\/vercel\.[0-9a-f]{8}\.png(?:\?.*)?"\)$/
) )
) )
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment