Kaynağa Gözat

Fix TAGLINE sed delimiter and add apostrophe tagline E2E test

- Switch TAGLINE sed from '#' to '/' delimiter so html_escape'd
  apostrophes (') don't break the sed expression
- Add standalone-apostrophe Docker service with TAGLINE="It'd rather be fast!"
- Add standaloneApostrophe URL (port 18186) to env.js
- Add E2E test asserting the apostrophe tagline renders correctly

Agent-Logs-Url: https://github.com/librespeed/speedtest/sessions/ebe265a8-4b1e-49b5-959a-66133ea0ab3a

Co-authored-by: sstidl <12804296+sstidl@users.noreply.github.com>
copilot-swe-agent[bot] 3 ay önce
ebeveyn
işleme
a1e0a77ab5

+ 1 - 1
docker/entrypoint.sh

@@ -115,7 +115,7 @@ if [[ "$MODE" == "frontend" || "$MODE" == "dual" ||  "$MODE" == "standalone" ]];
     TAGLINE_ONE_LINE=${TAGLINE_ONE_LINE//$'\n'/ }
     TAGLINE_HTML_ESCAPED=$(html_escape "$TAGLINE_ONE_LINE")
     TAGLINE_ESCAPED=$(sed_escape "$TAGLINE_HTML_ESCAPED")
-    sed -i "s#<p class=\"tagline\">No Flash, No Java, No Websockets, No Bullsh\\*t<\\/p>#<p class=\"tagline\">$TAGLINE_ESCAPED<\\/p>#g" /var/www/html/index-modern.html
+    sed -i "s/<p class=\"tagline\">No Flash, No Java, No Websockets, No Bullsh\\*t<\\/p>/<p class=\"tagline\">$TAGLINE_ESCAPED<\\/p>/g" /var/www/html/index-modern.html
   fi
   
   # Support legacy EMAIL env var as fallback for GDPR_EMAIL

+ 12 - 0
tests/docker-compose-playwright.yml

@@ -31,6 +31,18 @@ services:
     ports:
       - "18185:8080"
 
+  standalone-apostrophe:
+    build:
+      context: ..
+      dockerfile: Dockerfile
+    environment:
+      - MODE=standalone
+      - WEBPORT=8080
+      - USE_NEW_DESIGN=true
+      - "TAGLINE=It'd rather be fast!"
+    ports:
+      - "18186:8080"
+
   backend:
     build:
       context: ..

+ 1 - 0
tests/e2e/helpers/env.js

@@ -4,6 +4,7 @@ const baseUrls = {
   frontend: 'http://127.0.0.1:18182',
   dual: 'http://127.0.0.1:18183',
   standaloneNew: 'http://127.0.0.1:18185',
+  standaloneApostrophe: 'http://127.0.0.1:18186',
 };
 
 module.exports = {

+ 6 - 0
tests/e2e/title-special-chars.spec.js

@@ -3,6 +3,7 @@ const { baseUrls } = require('./helpers/env');
 
 const specialTitle = 'Grüße "Tempo" \'Österreich\'';
 const specialTagline = 'No "Flash", <No Java>, No Websockets & No Bullsh*t';
+const apostropheTagline = "It'd rather be fast!";
 
 test.describe('TITLE and TAGLINE special characters', () => {
   test('modern page title supports umlauts and quotes', async ({ page }) => {
@@ -16,4 +17,9 @@ test.describe('TITLE and TAGLINE special characters', () => {
     await page.goto(`${baseUrls.standaloneNew}/index-classic.html`);
     await expect(page.locator('h1').first()).toHaveText(specialTitle);
   });
+
+  test('modern page tagline renders apostrophe correctly', async ({ page }) => {
+    await page.goto(`${baseUrls.standaloneApostrophe}/index-modern.html`);
+    await expect(page.locator('main > p.tagline')).toHaveText(apostropheTagline);
+  });
 });