Skip to content

Moved timezone display test from e2e-browser to Ember acceptance#27036

Merged
9larsons merged 1 commit intomainfrom
move-timezone-test-to-ember
Apr 1, 2026
Merged

Moved timezone display test from e2e-browser to Ember acceptance#27036
9larsons merged 1 commit intomainfrom
move-timezone-test-to-ember

Conversation

@9larsons
Copy link
Copy Markdown
Contributor

@9larsons 9larsons commented Apr 1, 2026

ref https://linear.app/ghost/issue/PLA-10/

The test verifies that the post settings menu date-time-picker displays the correct time when the site timezone changes. This is a client-side formatting concern that doesn't need a full browser e2e test — Mirage can mock the settings and post data directly - it likely never should've been an e2e test.

The test verifies that the post settings menu date-time-picker displays
the correct time when the site timezone changes. This is a client-side
formatting concern that doesn't need a full browser e2e test — Mirage
can mock the settings and post data directly.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

Walkthrough

This pull request introduces a new Ember acceptance test suite for the post settings menu in the editor, replacing existing Playwright-based end-to-end tests. A test file is added at ghost/admin/tests/acceptance/editor/post-settings-menu-test.js that verifies timezone conversion functionality in the date-time picker when a published post's timestamp is displayed. Correspondingly, Playwright helper functions (openPublishFlow, closePublishFlow, openPostSettingsMenu, publishPost) are removed from the e2e browser tests, and a timezone test is relocated to the new Ember acceptance test suite. The remaining e2e tests are refactored to use direct element interaction instead of the deleted helpers.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: moving a timezone display test from e2e-browser testing to Ember acceptance testing.
Description check ✅ Passed The description is clearly related to the changeset, explaining both what was moved and the rationale for the change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch move-timezone-test-to-ember

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@9larsons 9larsons enabled auto-merge (squash) April 1, 2026 02:10
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
ghost/admin/tests/acceptance/editor/post-settings-menu-test.js (1)

47-47: Strengthen the date assertion to avoid false positives.

Line 47 only validates the day suffix, so incorrect month/year would still pass. Prefer asserting the full expected date string.

Proposed tweak
-        expect(find('[data-test-date-time-picker-date-input]').value, 'date in JST').to.match(/-15$/);
+        expect(find('[data-test-date-time-picker-date-input]').value, 'date in JST').to.equal('2024-01-15');
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ghost/admin/tests/acceptance/editor/post-settings-menu-test.js` at line 47,
The current assertion on find('[data-test-date-time-picker-date-input]').value
only checks the day suffix and can pass with wrong month/year; update the test
in post-settings-menu-test.js to assert the full expected date string (e.g.,
exact YYYY-MM-DD or the complete formatted value you expect) instead of using
/\. -15$/—locate the expect call that wraps
find('[data-test-date-time-picker-date-input]').value and replace the partial
regex check with a strict equality or full-match regex for the complete date
string so the test fails for incorrect month/year.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@ghost/admin/tests/acceptance/editor/post-settings-menu-test.js`:
- Line 47: The current assertion on
find('[data-test-date-time-picker-date-input]').value only checks the day suffix
and can pass with wrong month/year; update the test in
post-settings-menu-test.js to assert the full expected date string (e.g., exact
YYYY-MM-DD or the complete formatted value you expect) instead of using /\.
-15$/—locate the expect call that wraps
find('[data-test-date-time-picker-date-input]').value and replace the partial
regex check with a strict equality or full-match regex for the complete date
string so the test fails for incorrect month/year.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a12bc420-09e8-40bd-b26c-ad986b1f966d

📥 Commits

Reviewing files that changed from the base of the PR and between 60a8165 and 55eb475.

📒 Files selected for processing (2)
  • ghost/admin/tests/acceptance/editor/post-settings-menu-test.js
  • ghost/core/test/e2e-browser/admin/publishing.spec.js

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.27%. Comparing base (9183778) to head (55eb475).
⚠️ Report is 21 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #27036      +/-   ##
==========================================
+ Coverage   73.20%   73.27%   +0.07%     
==========================================
  Files        1540     1530      -10     
  Lines      121786   121733      -53     
  Branches    14713    14707       -6     
==========================================
+ Hits        89149    89199      +50     
+ Misses      31606    31537      -69     
+ Partials     1031      997      -34     
Flag Coverage Δ
admin-tests 54.37% <ø> (+0.02%) ⬆️
e2e-tests 73.27% <ø> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@9larsons 9larsons merged commit 33818ee into main Apr 1, 2026
39 checks passed
@9larsons 9larsons deleted the move-timezone-test-to-ember branch April 1, 2026 02:34
9larsons added a commit that referenced this pull request Apr 1, 2026
)

ref https://linear.app/ghost/issue/PLA-10/

The test verifies that the post settings menu date-time-picker displays
the correct time when the site timezone changes. This is a client-side
formatting concern that doesn't need a full browser e2e test — Mirage
can mock the settings and post data directly - it likely never should've
been an e2e test.
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.

1 participant