Skip to content

chore: apps converters golden spec breaking unit tests - #41756

Merged
sampaiodiego merged 1 commit into
release-9.0.0from
chore/fix-apps-converters-golden-spec
Aug 12, 2026
Merged

chore: apps converters golden spec breaking unit tests#41756
sampaiodiego merged 1 commit into
release-9.0.0from
chore/fix-apps-converters-golden-spec

Conversation

@ricardogarim

@ricardogarim ricardogarim commented Aug 11, 2026

Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

Unit tests have been failing on release-9.0.0 since the develop merge on 21 Jul.

Problem. A spec from develop imports the apps uploads converter → codec → getURLserver/settings, which ends in a top-level await that mocha can't transpile to CJS. Mocha resolves every spec before running any, so this aborts the whole stage: all 2159 tests go dark rather than red.

Why CI was green on both sides. Neither half breaks alone. #41054 (into release-9.0.0, 30 Jun) added the getURL import to the codec, before the spec existed. #41400 (into develop, 17 Jul) added the spec, and develop has no /ufs removal so its codec has no getURL import. They first met in the 21 Jul merge, and since they don't overlap textually there was no conflict to report. The top-level await itself predates all of this by years — it was just never reachable from a mocha spec.

Fix. Load the converter through proxyquire with getURL stubbed, and update the uploads expectations, which still asserted the url/path pass-through that #41054 intentionally removed.

Test-only, no production code touched.

Issue(s)

Regression from the interaction of #41054 and #41400. No tracking issue.

Steps to test or reproduce

Run yarn testunit from apps/meteor — passes on this branch, fails on release-9.0.0.

Further comments

The top-level await stays, so any future unit test importing into server/settings breaks the stage the same way — aborting the run rather than reporting a failure. Worth a follow-up on develop.

No changeset: this PR changes no behaviour.

Summary by CodeRabbit

  • Tests
    • Updated upload conversion tests to use a stubbed URL provider.
    • Revised snapshots to reflect the generated upload path and site URL.

@dionisio-bot

dionisio-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 91909a7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 717ad336-f6eb-4bf4-bbb4-e3ddbd0b39d7

📥 Commits

Reviewing files that changed from the base of the PR and between 416bb8a and 91909a7.

📒 Files selected for processing (1)
  • apps/meteor/tests/unit/app/apps/server/converters.golden.spec.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout. (7)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Hacktron Security Check
  • GitHub Check: 🚢 Build Docker (amd64, account-service, presence-service, omnichannel-transcript-service, cove...
  • GitHub Check: 🚢 Build Docker (amd64, account-service, presence-service, omnichannel-transcript-service, fips)
  • GitHub Check: 🚢 Build Docker (amd64, authorization-service, queue-worker-service, ddp-streamer-service, cove...
  • GitHub Check: 🚢 Build Docker (amd64, authorization-service, queue-worker-service, ddp-streamer-service, fips)
  • GitHub Check: 🔎 Code Check / Code Lint
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/tests/unit/app/apps/server/converters.golden.spec.ts
**/*.spec.ts

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.spec.ts: Use descriptive test names that clearly communicate expected behavior in Playwright tests
Use .spec.ts extension for test files (e.g., login.spec.ts)

Files:

  • apps/meteor/tests/unit/app/apps/server/converters.golden.spec.ts
apps/meteor/**

📄 CodeRabbit inference engine (CLAUDE.md)

The main Rocket.Chat Meteor application resides in apps/meteor/; place its application code there rather than in other monorepo areas.

Files:

  • apps/meteor/tests/unit/app/apps/server/converters.golden.spec.ts
🧠 Learnings (5)
📚 Learning: 2026-02-24T19:22:48.358Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/omnichannel/omnichannel-send-pdf-transcript.spec.ts:66-67
Timestamp: 2026-02-24T19:22:48.358Z
Learning: In Playwright end-to-end tests (e.g., under apps/meteor/tests/e2e/...), prefer locating elements by translated text (getByText) and ARIA roles (getByRole) over data-qa attributes. If translation values change, update the corresponding test locators accordingly. Never use data-qa locators. This guideline applies to all Playwright e2e test specs in the repository and helps keep tests robust to UI text changes and accessible semantics.

Applied to files:

  • apps/meteor/tests/unit/app/apps/server/converters.golden.spec.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/tests/unit/app/apps/server/converters.golden.spec.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/tests/unit/app/apps/server/converters.golden.spec.ts
📚 Learning: 2026-03-06T18:10:15.268Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 39397
File: packages/gazzodown/src/code/CodeBlock.spec.tsx:47-68
Timestamp: 2026-03-06T18:10:15.268Z
Learning: In tests (especially those using testing-library/dom/jsdom) for Rocket.Chat components, the HTML <code> element has an implicit ARIA role of 'code'. Therefore, screen.getByRole('code') or screen.findByRole('code') will locate <code> elements even without a role attribute. Do not flag findByRole('code') as invalid in reviews; prefer using the implicit role instead of adding role="code" unless necessary for accessibility.

Applied to files:

  • apps/meteor/tests/unit/app/apps/server/converters.golden.spec.ts
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • apps/meteor/tests/unit/app/apps/server/converters.golden.spec.ts
🔇 Additional comments (3)
apps/meteor/tests/unit/app/apps/server/converters.golden.spec.ts (3)

3-3: LGTM!

Also applies to: 11-12


481-488: LGTM!


526-528: LGTM!


Walkthrough

The golden test now loads AppUploadsConverter with a stubbed getURL dependency. The upload snapshot expects the converter-generated path and stubbed site URL.

Changes

Uploads converter golden test

Layer / File(s) Summary
Stub uploads converter URL dependency
apps/meteor/tests/unit/app/apps/server/converters.golden.spec.ts
The test uses proxyquire to stub getURL and updates the upload snapshot to match the generated upload path and site URL.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested labels: type: chore

Suggested reviewers: d-gubert

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title identifies the affected apps converter golden spec and its failing unit tests, which matches the pull request objective.

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.

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.82%. Comparing base (416bb8a) to head (91909a7).

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##           release-9.0.0   #41756      +/-   ##
=================================================
- Coverage          68.84%   68.82%   -0.02%     
=================================================
  Files               4134     4133       -1     
  Lines             158195   158161      -34     
  Branches           28021    28042      +21     
=================================================
- Hits              108906   108858      -48     
- Misses             44145    44155      +10     
- Partials            5144     5148       +4     
Flag Coverage Δ
e2e 59.19% <ø> (-0.02%) ⬇️
e2e-api 46.02% <ø> (-0.03%) ⬇️
unit 70.52% <ø> (-0.04%) ⬇️

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

🚀 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.

@ricardogarim
ricardogarim force-pushed the chore/fix-apps-converters-golden-spec branch from e9d0252 to 91909a7 Compare August 11, 2026 23:34
@ricardogarim
ricardogarim marked this pull request as ready for review August 11, 2026 23:45
@ricardogarim
ricardogarim requested a review from a team as a code owner August 11, 2026 23:45
@ricardogarim ricardogarim changed the title chore: fix apps converters golden spec breaking unit tests chore: apps converters golden spec breaking unit tests Aug 11, 2026
@ricardogarim ricardogarim added this to the 9.0.0 milestone Aug 11, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

@sampaiodiego
sampaiodiego merged commit e7cd9a3 into release-9.0.0 Aug 12, 2026
56 checks passed
@sampaiodiego
sampaiodiego deleted the chore/fix-apps-converters-golden-spec branch August 12, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants