Skip to content

test: e2e tests for locale translation of data-driven content#225

Merged
serroba merged 1 commit intomainfrom
test/locale-content-e2e
Apr 10, 2026
Merged

test: e2e tests for locale translation of data-driven content#225
serroba merged 1 commit intomainfrom
test/locale-content-e2e

Conversation

@serroba
Copy link
Copy Markdown
Owner

@serroba serroba commented Apr 10, 2026

Summary

  • Adds locale-content.spec.ts covering the gap identified when investigating a reported regression in the AI scaling section
  • Tests that preset pills (explore), chart panel titles, dropdown options, metric row labels, and column headers are correctly translated in German and Spanish locales
  • These scenarios were previously untested — the existing localization tests only checked static chrome (nav items, toggle buttons)

Test plan

  • All 7 new tests pass locally (npx playwright test test/e2e/locale-content.spec.ts)
  • Full e2e suite still passes (29 + 7 = 36 tests)

🤖 Generated with Claude Code

Covers the gap identified when investigating the AI scaling language
regression: preset pills, chart panel titles, dropdown options, metric
row labels, and column headers in German and Spanish locales.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 10, 2026 07:28
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Apr 10, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
world3 48d55a1 Commit Preview URL

Branch Preview URL
Apr 10 2026, 07:28 AM

@github-actions
Copy link
Copy Markdown

Simulation Check

BAU scenario executed successfully on this branch.

Simulation Summary (click to expand)
World3 Simulation Summary (1900-2100, dt=0.5)

Population
----------
  pop        Total population                              1600000000.00 -> 2708929308.98  min=1600000000.00  max=8230735005.94  (declining)
  le         Life expectancy                                      28.96 ->        38.92  min=15.59         max=83.15         (declining)
  p1         Population ages 0-14                          650000000.00 -> 754254147.88  min=626209826.02  max=1846103650.37  (declining)
  p2         Population ages 15-44                         700000000.00 -> 1122907005.77  min=700000000.00  max=3234364562.67  (declining)
  p3         Population ages 45-64                         190000000.00 -> 526475770.96  min=190000000.00  max=1740874541.66  (declining)
  p4         Population ages 65+                            60000000.00 -> 305292384.38  min=60000000.00   max=1580948008.72  (declining)
  b          Births per year                                62860949.27 ->  70279891.03  min=62860949.27   max=138015154.12  (declining)
  d          Deaths per year                                       0.00 ->  74149936.43  min=0.00          max=349601095.40  (rising)
  cbr        Crude birth rate                                      0.00 ->        25.92  min=0.00          max=40.98         (rising)
  cdr        Crude death rate                                      0.00 ->        27.37  min=0.00          max=57.52         (rising)
  lf         Labor force                                   667500000.00 -> 1237037082.54  min=667500000.00  max=3725420875.03  (declining)
  fpu        Food potential utilization                            0.16 ->         0.27  min=0.16          max=0.59          (declining)
  lmhs       Lifetime multiplier from health services              1.03 ->         1.47  min=1.03          max=2.00          (stable)
  lmc        Lifetime multiplier from crowding                     0.93 ->         0.86  min=0.79          max=1.06          (declining)
  tf         Total fertility                                       5.39 ->         3.76  min=1.37          max=5.95          (rising)
  mtf        Maximum total fertility                               6.95 ->         9.34  min=3.74          max=13.20         (declining)
  dtf        Desired total fertility                               4.95 ->         3.11  min=1.37          max=5.21          (rising)
  dcfs       Desired completed family size                         3.54 ->         2.36  min=1.37          max=3.72          (declining)
  cmple      Compensatory multiplier from perceived life expectancy         1.40 ->         1.32  min=1.00          max=1.47          (rising)
  sfsn       Social family size norm                               1.19 ->         1.24  min=0.72          max=1.24          (rising)
  fce        Fertility control effectiveness                       0.78 ->         0.90  min=0.77          max=1.00          (stable)

Capital
-------
  iopc       Industrial output per capita                         41.56 ->         0.72  min=0.72          max=440.88        (declining)
  ic         Industrial capital                            210000000000.00 -> 232705553754.65  min=210000000000.00  max=12654386758712.15  (declining)
  sc         Service capital                               144000000000.00 -> 222917587995.31  min=144000000000.00  max=5912640580302.54  (declining)
  io         Industrial output                             66500000000.00 -> 1959844198.34  min=1959844198.34  max=3554457326348.28  (declining)
  so         Service output                                144000000000.00 -> 185883064410.84  min=143352017959.64  max=5912640580302.54  (declining)
  sopc       Service output per capita                            90.00 ->        68.62  min=68.62         max=719.46        (declining)
  fioai      Fraction industrial output for industry               0.35 ->         0.47  min=0.29          max=0.50          (rising)
  fioaa      Fraction industrial output for agriculture            0.11 ->         0.07  min=0.07          max=0.27          (declining)
  fioas      Fraction industrial output for services               0.11 ->         0.03  min=0.00          max=0.13          (declining)
  fioac      Fraction industrial output for consumption            0.43 ->         0.43  min=0.43          max=0.43          (stable)
  j          Jobs                                          952109077.91 -> 4508088937.90  min=672254874.83  max=5373792657.01  (rising)
  cuf        Capital utilization fraction                          1.00 ->         0.83  min=0.82          max=1.00          (declining)
  luf        Labor utilization fraction                            1.43 ->         3.64  min=0.65          max=3.81          (rising)
  hsapc      Health services per capita                            7.20 ->         5.49  min=5.49          max=89.50         (declining)

Agriculture
-----------
  fpc        Food per capita                                     267.43 ->       281.15  min=81.22         max=482.81        (declining)
  al         Arable land                                   900000000.00 -> 2095306641.30  min=900000000.00  max=2265431552.95  (rising)
  pal        Potentially arable land                       2300000000.00 -> 284553590.26  min=284553590.26  max=2300000000.00  (declining)
  uil        Urban-industrial land                           8200000.00 -> 123197914.79  min=8200000.00    max=123197914.79  (rising)
  lfert      Land fertility                                      600.00 ->       574.88  min=146.94        max=600.00        (declining)
  ly         Land yield                                          754.65 ->       576.96  min=256.75        max=2677.54       (declining)
  f          Total food production                         427885462473.48 -> 761608981024.57  min=352484076308.44  max=3667275620517.99  (declining)
  ai         Agricultural inputs                           4873200261.74 -> 158416525.20  min=158416525.20  max=527446348997.38  (declining)
  pfr        Perceived food ratio                                  1.27 ->         1.21  min=0.36          max=2.10          (declining)
  tai        Total agricultural investment                 7335144581.00 -> 132017049.51  min=132017049.51  max=622426790570.10  (declining)
  lymap      Land yield multiplier from air pollution              1.00 ->         1.00  min=1.00          max=1.00          (stable)
  fcapc      Food coefficient from affluence per capita            0.09 ->         0.34  min=0.08          max=21.58         (declining)
  fr         Food ratio                                            1.16 ->         1.22  min=0.35          max=2.10          (declining)
  falm       Fraction of inputs allocated to land maintenance         0.05 ->         0.05  min=0.01          max=0.07          (declining)
  aiph       Agricultural inputs per hectare                       5.15 ->         0.07  min=0.07          max=218.23        (declining)
  ler        Land erosion rate                                994877.84 ->   2079335.70  min=994877.84     max=7994424.70    (declining)
  ldr        Land development rate                           3804300.94 ->         8.10  min=8.10          max=25934040.09   (declining)
  lrui       Land removal for urban-industrial use             79750.00 ->         0.00  min=0.00          max=2630463.30    (declining)

Pollution
---------
  ppolx      Pollution index                                       0.18 ->         0.19  min=0.04          max=18.17         (declining)
  ppol       Persistent pollution                           25000000.00 ->  26038830.65  min=5006525.20    max=2471225549.70  (declining)
  ppapr      Persistent pollution appearance rate            1799434.41 ->   9756317.67  min=1799434.41    max=730237988.17  (declining)
  ppasr      Persistent pollution assimilation rate         11904761.90 ->  12399443.17  min=2384059.62    max=697624148.81  (declining)
  ppgai      Persistent pollution generation by AI                 0.00 ->         0.00  min=0.00          max=0.00          (stable)
  aiofrac    AI fraction of industrial output                      0.00 ->         0.00  min=0.00          max=0.00          (stable)
  aiout      AI output                                             0.00 ->         0.00  min=0.00          max=0.00          (stable)
  aipi       AI pollution intensity                                0.00 ->         0.00  min=0.00          max=0.00          (stable)
  aiptcm     AI pollution tech-change multiplier                   0.70 ->         2.70  min=0.70          max=2.70          (rising)

Resources
---------
  nrfr       Nonrenewable resource fraction remaining              1.00 ->         0.00  min=0.00          max=1.00          (declining)
  nr         Nonrenewable resources remaining              1000000000000.00 -> 3787482011.38  min=3787482011.38  max=1000000000000.00  (declining)
  nrur       Nonrenewable resource usage rate              282625000.00 ->   8329337.84  min=8329337.84    max=23909283335.85  (declining)
  fcaor      Fraction capital allocated to obtaining resources         0.05 ->         0.97  min=0.05          max=0.97          (rising)

BAU Scenario Plot

World3 BAU Simulation


Generated automatically by CI on commit f2033c4

@serroba serroba merged commit 6778600 into main Apr 10, 2026
16 checks passed
@serroba serroba deleted the test/locale-content-e2e branch April 10, 2026 07:29
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Playwright E2E coverage to ensure locale-prefixed routes correctly translate data-driven UI content (not just static navigation/chrome), addressing a previously untested regression area.

Changes:

  • Introduces a new E2E spec asserting translated preset pills, chart titles, compare dropdown options, metric labels, and compare table headers in German and Spanish.
  • Exercises both /explore and /compare flows under locale-prefixed URLs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

* E2E tests for locale translation of data-driven content.
*
* The existing localization tests only check static chrome (nav, toggles).
* These tests verify that preset names, preset descriptions, and variable
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File header comment says these tests verify preset descriptions are translated, but none of the assertions currently check descriptions (only preset names, chart titles, and metric labels). Either add an assertion that verifies a translated description is shown (e.g., in compare dropdown option text after the dash) or adjust the comment to avoid misleading future readers.

Suggested change
* These tests verify that preset names, preset descriptions, and variable
* These tests verify that preset names, chart titles, and variable/metric

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants