diff --git a/test/integration/image-future/default/pages/static-img.js b/test/integration/image-future/default/pages/static-img.js index d5ce76c1289809b..6b6b4cfd5739e33 100644 --- a/test/integration/image-future/default/pages/static-img.js +++ b/test/integration/image-future/default/pages/static-img.js @@ -36,6 +36,10 @@ const Page = () => { + + + +
diff --git a/test/integration/image-future/default/test/static.test.ts b/test/integration/image-future/default/test/static.test.ts index 7e02bf407b2b8d0..b2d08bc857a1389 100644 --- a/test/integration/image-future/default/test/static.test.ts +++ b/test/integration/image-future/default/test/static.test.ts @@ -6,6 +6,7 @@ import { renderViaHTTP, File, waitFor, + launchApp, } from 'next-test-utils' import webdriver from 'next-webdriver' import { join } from 'path' @@ -29,6 +30,10 @@ const runTests = () => { expect(await browser.elementById('static-gif')).toBeTruthy() expect(await browser.elementById('static-bmp')).toBeTruthy() expect(await browser.elementById('static-ico')).toBeTruthy() + expect(await browser.elementById('static-svg-fill')).toBeTruthy() + expect(await browser.elementById('static-gif-fill')).toBeTruthy() + expect(await browser.elementById('static-bmp-fill')).toBeTruthy() + expect(await browser.elementById('static-ico-fill')).toBeTruthy() expect(await browser.elementById('static-unoptimized')).toBeTruthy() }) it('Should use immutable cache-control header for static import', async () => { @@ -90,15 +95,30 @@ describe('Build Error Tests', () => { }) }) describe('Future Static Image Component Tests', () => { - beforeAll(async () => { - await nextBuild(appDir) - appPort = await findPort() - app = await nextStart(appDir, appPort) - html = await renderViaHTTP(appPort, '/static-img') - browser = await webdriver(appPort, '/static-img') + describe('production mode', () => { + beforeAll(async () => { + await nextBuild(appDir) + appPort = await findPort() + app = await nextStart(appDir, appPort) + html = await renderViaHTTP(appPort, '/static-img') + browser = await webdriver(appPort, '/static-img') + }) + afterAll(() => { + killApp(app) + }) + runTests() }) - afterAll(() => { - killApp(app) + + describe('dev mode', () => { + beforeAll(async () => { + appPort = await findPort() + app = await launchApp(appDir, appPort) + html = await renderViaHTTP(appPort, '/static-img') + browser = await webdriver(appPort, '/static-img') + }) + afterAll(() => { + killApp(app) + }) + runTests() }) - runTests() })