Repository navigation
Tests: Verify timezone persistence and restore the original setting - #14207
lancewillett wants to merge 3 commits into
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Review of e08b2a4. No blockers, and no changes requested to the test.
One change requested, to the description:
Track later, outside this diff: the spec still finds its controls by AI review · |
|
Fixed in 9d6a06c. The settings form displays UTC+0:30 and UTC−0:30 as UTC+0, so restoring its selected value silently changed the original offset—even while the test passed. Setup and cleanup now preserve the stored AI review · |
There was a problem hiding this comment.
🟡 Changes recommended
CLI site targeting can leave subsite settings unrestored, and dotenv output can break setup JSON parsing.
2 open findings
What changed in this PR
Strengthens the existing invalid-timezone tests to verify persistence and restore the site's original timezone settings.
Changes:
- Captures and restores both timezone options through WP-CLI.
- Selects a different valid timezone and checks save feedback.
- Reloads settings to verify persistence after each invalid submission.
| File | Description |
|---|---|
| tests/e2e/specs/general-settings-invalid-timezone.test.js | Adds option restoration and stronger persistence assertions. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
PR #14207 landed in https://core.trac.wordpress.org/changeset/64584 |
Check successful timezone saves, rejection of invalid values, and persistence after reloading General Settings. Preserve and restore both `timezone_string` and `gmt_offset`, including half-hour offsets, using WP-CLI against the same site as the browser. Keep dotenv output quiet when reading the saved options as JSON. Developed in: #14207 Props juhise, lucatume. See #52895. git-svn-id: https://develop.svn.wordpress.org/trunk@64584 602fd350-edb4-49c9-b593-d223f7449a82
Check successful timezone saves, rejection of invalid values, and persistence after reloading General Settings. Preserve and restore both `timezone_string` and `gmt_offset`, including half-hour offsets, using WP-CLI against the same site as the browser. Keep dotenv output quiet when reading the saved options as JSON. Developed in: WordPress/wordpress-develop#14207 Props juhise, lucatume. See #52895. Built from https://develop.svn.wordpress.org/trunk@64584 git-svn-id: http://core.svn.wordpress.org/trunk@63734 1a063a9b-81f0-0310-95a4-ce76da25c4cd

The invalid-timezone tests currently leave the site using Lisbon and check only the form returned after submission. Capture and restore the stored timezone options, confirm successful saves, and reload settings to verify the last valid value persisted after an invalid submission.
Retains the three existing invalid inputs. Selects a different valid timezone when the site already uses Lisbon. Setup and cleanup use WP-CLI to preserve both
timezone_stringandgmt_offset, including offsets that the settings form displays incorrectly. The test still submits valid and invalid timezone values through the browser. Carries forward the useful improvements from #8092 into the existing spec.Trac: https://core.trac.wordpress.org/ticket/52895
Validation: all three cases passed three repetitions in local Chromium on multisite with retries disabled (9 checks). Additional probes verified restoration of UTC+0:30, UTC−0:30, UTC+5:30, and an already-Lisbon setting. An intentional failure away from Settings also preserved the original stored options. Probe code was removed and local settings restored. The scoped E2E audit, JavaScript type checking, syntax, and whitespace checks passed.
Use of AI Tools
AI assistance: Yes
Tool: OpenAI Codex
Model: GPT-6
Used for: Implementing the test changes, running local validation, auditing the diff, and drafting this description.