block-editor test suite is red on main: 16 suites / 37 tests failing after the Angular 22 migration
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
Description
nx run block-editor:test is red on main: 16 of 29 suites and 37 of 122 tests fail. This is fallout from the Angular 22 migration, not from any single recent change — libs/block-editor is byte-identical between main and the strict-mode branch, and the failures reproduce on both.
Found while working #35955 (TS strict mode for block-editor). Strict mode landed with the suite left exactly as it was: the same 38 failing entries by name, before and after. That work is type-only and does not touch these failures — but it also means block-editor currently has no runtime safety net, which is the real cost.
Failure causes
Every failure traces to one of four mechanical causes. None of them are logic bugs.
| Cause | Occurrences |
|---|---|
Unexpected "<X>" found in the "declarations" array — standalone components declared in an NgModule |
28 |
TypeError: this.editor.setEditable is not a function — the TipTap editor mock predates v3 |
20 |
TypeError: this.editor.destroy is not a function — same mock |
10 |
NG0201: No provider found for SuggestionsService |
2 |
Affected components: TestComponent, TestFormComponent, FileUploadMockComponent, UploadPlaceholderComponent, DotImageEditorPopoverComponent, AIContentPromptComponent.
Acceptance Criteria
-
nx run block-editor:testpasses — 0 failing suites, 0 failing tests. - Standalone components move from
declarationstoimportsin every affectedTestBed.configureTestingModulecall. - The TipTap editor mock covers the v3 surface the components actually call (
setEditable,destroy, …), or the specs build a realEditorwhere that is cheaper. -
SuggestionsComponent's spec providesSuggestionsService. - No test is deleted or skipped to reach green. If a test is genuinely obsolete, say why in the PR.
Notes
Two related repairs already landed with #35955 and are not part of this issue:
asset-form.component.spec.tswas an orphan spec forImageTabviewFormComponent, a component that no longer exists onmain. Deleted.dot-upload-asset.component.spec.tsimportedDotUploadFileServicefrom block-editor'ssharedbarrel; it lives in@dotcms/data-access. The stale import meant the spec provided a different token than the component injected.
libs/block-editor is @deprecated — kept on the rollback path behind FEATURE_FLAG_NEW_BLOCK_EDITOR until the new TipTap-v3 editor exits QA. That is precisely why the suite needs to work: it guards the fallback.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running nx run block-editor:test and inspect the affected specs under libs/block-editor, focusing on each TestBed.configureTestingModule call and the shared TipTap editor mock. Update the listed standalone-component declarations, mock methods, and SuggestionsService provider without deleting or skipping tests. Done means the command reports zero failing suites and tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- frontend, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 66/100