Opened 9 years ago
Last modified 18 months ago
#35857 assigned task (blessed)
Add QUnit tests for Customizer preview, including Selective Refresh
Reported by: | westonruter | Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | 3.4 |
Component: | Customize | Keywords: | needs-patch needs-unit-tests |
Focuses: | javascript | Cc: |
Description
Initial Customizer unit tests for PHP and JS were added in #28579. The QUnit tests were done specifically for the Customizer controls (pane) and not the Customizer preview. This was understandable since he preview was devoid of much unique JS functionality. With the introduction of the Selective Refresh component (#27355), this has changed. There needs to be a new QUnit test suite specifically for the Customizer preview.
See @valendesigns initial foundation work here: https://github.com/xwp/wp-customize-partial-refresh/pull/32/files#diff-6fcbfd120899db12c05cdb1f6142cd87
Change History (23)
This ticket was mentioned in Slack in #core by chriscct7. View the logs.
9 years ago
This ticket was mentioned in Slack in #core by chriscct7. View the logs.
9 years ago
#6
@
9 years ago
@westonruter + @ryankienstra is this going to make the release or should it be punted out?
#7
@
9 years ago
Estimate
Hi @chriscct7 and @westonruter,
Sorry, these "Selective Refresh" unit tests probably won't be ready in a few days. A more likely timeframe is around a week.
I've been pushing to a work-in-progress GitHub pull request.
If this needs to be expedited so we at least have some tests in 4.5, that would be fine. But completing these unit tests in a few days probably won't be possible.
#8
@
9 years ago
Unit tests can be committed at practically any time, so I'm not concerned about them making a beta release.
This ticket was mentioned in Slack in #core by westonruter. View the logs.
9 years ago
#10
@
8 years ago
Fine with this riding, as it's only a ticket for tests, and they're not bounded by RC.
Better testing for new features is always good.
This ticket was mentioned in Slack in #core by mike. View the logs.
8 years ago
#12
@
8 years ago
Are you still planning on doing this, @westonruter @ryankienstra?
If not, we need to decide if this ticket is a requirement before release and can be punted to Future Release or not.
#13
@
8 years ago
- Keywords 4.6-early added
- Milestone changed from 4.5 to Future Release
- Owner ryankienstra deleted
Punting.
#14
@
8 years ago
(If anyone has has a patch it can still be committed before 4.5 is released, but I'm punting to remove this from the radar as a 4.5 release requirement.)
#15
@
8 years ago
Latest Commits In Pull Request
This pull request has my latest commits. Including one that mocks a setting change, and tests that the partial refreshes properly.
I'm sorry for the delay in this work. Thanks to @westonruter for his input on this pull request.
#18
@
8 years ago
@ryankienstra Are you still working on a patch here? Would be nice to have tests here really soon so we can make sure that future changes don't break the initial committed version.
#20
@
8 years ago
Unit Tests Mainly Complete
But Failing Travis CI Build
Hi @ocean90,
Sorry for the long delay here. These unit tests are mainly finished, as part of a GitHub pull request.
But they are failing a Travis CI. One of the build tasks failed with this message:
Testing tests/qunit/customize-preview.html ...F PhantomJS timed out, possibly due to: - QUnit is not loaded correctly. - A missing QUnit start() call. - Or, a misconfiguration of this task. Testing tests/qunit/index.html .
I'm not sure how to fix this, but I'll work on it.
#21
@
8 years ago
- Milestone changed from 4.6 to Future Release
Punting due to lack of a patch. Feel free to move it back if you can get a patch ready before 4.6.
Something that the QUnit tests for the Customizer thus far have somewhat lacked in thus far is properly setting up and tearing down the global state with each test. The tests for the Customizer pane largely are adding and removing things from the global state without regard for how those will impact other tests. In other words, they are more integration tests than unit tests… and they can be more fragile since they aren't encapsulated. To make the unit tests more robust in the preview, I suggest that we be more disciplined from the start at architecting the unit tests in a way that teach test does state setup
beforeEach
, and tears down any global stateafterEach
.