Skip to content

test: create automated tests for ldap login - #36810

Open
jessicaschelly wants to merge 13 commits into
developfrom
test/ldap-tests
Open

test: create automated tests for ldap login#36810
jessicaschelly wants to merge 13 commits into
developfrom
test/ldap-tests

Conversation

@jessicaschelly

@jessicaschelly jessicaschelly commented Aug 27, 2025

Copy link
Copy Markdown
Member

Proposed changes

Adds end-to-end coverage for LDAP authentication using the existing OpenLDAP CI service.

  • Configures the LDAP settings required by the test while preserving and restoring their original values.
  • Verifies LDAP connectivity and user search through /ldap.testConnection and /ldap.testSearch.
  • Verifies login and LDAP field mapping for username, name, and email.
  • Adds a dedicated ldap.e2e identity under ou=others so the test does not overlap with ABAC synchronization.
  • Verifies jpegPhoto avatar synchronization by comparing the served avatar with a Playwright image snapshot.
  • Removes the test user through /users.delete before and after the suite to keep runs isolated.

Issue(s)

QA-95

Test coverage

  • LDAP connection
  • LDAP user search
  • LDAP login
  • Username, name, and email mapping
  • LDAP avatar synchronization
  • Settings restoration and test-user cleanup
  • Enterprise CI execution

Validation

  • Enterprise mode passes all 3 LDAP tests.
  • Community mode skips all 3 LDAP tests.
  • Prettier, ESLint, Compose configuration, and diff checks pass.

Further comments

The avatar baseline is intentionally committed because Playwright uses it for pixel comparison. The Linux suffix is generated automatically by Playwright and matches the CI platform.

Summary by CodeRabbit

  • Tests
    • Added end-to-end coverage for LDAP connection testing, user search, credential-based login, field mapping, and avatar synchronization.
    • Added test data for an LDAP user with profile details, email, password, and photo.
    • LDAP tests run only in Enterprise Edition environments and clean up test data afterward.

@dionisio-bot

dionisio-bot Bot commented Aug 27, 2025

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
  • This PR is targeting the wrong base branch. It should target 8.9.0, but it targets 8.8.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Aug 27, 2025

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0390f41

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

@codecov

codecov Bot commented Aug 27, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.59%. Comparing base (9d7087f) to head (0390f41).
⚠️ Report is 112 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #36810      +/-   ##
===========================================
- Coverage    68.67%   68.59%   -0.08%     
===========================================
  Files         4165     4308     +143     
  Lines       159294   172630   +13336     
  Branches     28215    31008    +2793     
===========================================
+ Hits        109390   118418    +9028     
- Misses       44747    48905    +4158     
- Partials      5157     5307     +150     
Flag Coverage Δ
unit 70.96% <ø> (+0.39%) ⬆️

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.

@jessicaschelly
jessicaschelly marked this pull request as ready for review August 28, 2025 12:02
@jessicaschelly
jessicaschelly requested a review from a team as a code owner August 28, 2025 12:02
@jessicaschelly jessicaschelly changed the title test: create automated tests for ldap test: create automated tests for ldap login Aug 28, 2025
@jessicaschelly jessicaschelly modified the milestones: 7.10.0, 7.11.0 Aug 28, 2025
@jessicaschelly
jessicaschelly marked this pull request as draft August 28, 2025 17:38
@coderabbitai

coderabbitai Bot commented Mar 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

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: d8d71898-e3e2-4bf0-b5a6-b406f78993e0

📥 Commits

Reviewing files that changed from the base of the PR and between 932e7b8 and 62678ff.

📒 Files selected for processing (1)
  • apps/meteor/tests/e2e/ldap.spec.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/meteor/tests/e2e/ldap.spec.ts

Included review availability: Your plan includes up to 10 reviews per rolling hour; 8 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: ⚙️ Test Guard
  • GitHub Check: ⚙️ Variables Setup
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
⚠️ CI failures not shown inline (4)

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ✅ **QA assured**
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ✅ **QA assured**
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ✅ **QA assured**
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ✅ **QA assured**
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

Walkthrough

The pull request adds LDAP Enterprise Edition end-to-end coverage. It configures and restores LDAP settings, adds a fixture user, validates connectivity and search, and verifies login, mapped fields, and avatar synchronization.

Changes

LDAP E2E coverage

Layer / File(s) Summary
LDAP configuration and fixture
apps/meteor/tests/e2e/ldap.spec.ts, development/ldap/02-data.ldif
The suite defines LDAP authentication, lookup, field mapping, and avatar settings. The fixture adds the ldap.e2e user with encoded credentials and JPEG data.
LDAP setup and cleanup
apps/meteor/tests/e2e/ldap.spec.ts
Helpers apply settings, wait for connection readiness, preserve original settings, and remove the test user after execution.
LDAP connection and login assertions
apps/meteor/tests/e2e/ldap.spec.ts
Tests verify connection testing, user search, credential login, mapped profile fields, and avatar synchronization.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 62678

This PR adds isolated LDAP end-to-end test coverage and preserves test-state cleanup; no actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant LDAP E2E suite
  participant Rocket.Chat LDAP service
  participant LDAP server
  LDAP E2E suite->>Rocket.Chat LDAP service: submit LDAP credentials
  Rocket.Chat LDAP service->>LDAP server: search and authenticate ldap.e2e
  LDAP server-->>Rocket.Chat LDAP service: return mapped fields and JPEG photo
  Rocket.Chat LDAP service-->>LDAP E2E suite: complete login and render profile
Loading

Suggested labels: type: chore, area: authentication

Suggested reviewers: dougfabris

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding automated tests for LDAP authentication.
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.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • QA-95: Request failed with status code 401

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.

@jessicaschelly
jessicaschelly changed the base branch from develop to chore/ldap/tests March 22, 2026 20:06
@github-actions

github-actions Bot commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

📦 Docker Image Size Report

📉 Changes

Service Current Baseline Change Percent
sum of all images 1.1GiB 1.2GiB -66MiB
rocketchat 360MiB 412MiB -53MiB
omnichannel-transcript-service 134MiB 137MiB -2.9MiB
queue-worker-service 134MiB 136MiB -2.9MiB
ddp-streamer-service 128MiB 130MiB -1.7MiB
account-service 115MiB 117MiB -1.7MiB
authorization-service 112MiB 114MiB -1.7MiB
presence-service 112MiB 114MiB -1.7MiB

📊 Historical Trend

---
config:
  theme: "dark"
  xyChart:
    width: 900
    height: 400
---
xychart
  title "Image Size Evolution by Service (Last 30 Days + This PR)"
  x-axis ["02/21 04:30", "02/22 19:30", "02/23 23:33", "02/24 23:28", "02/25 22:56", "02/26 23:19", "02/27 23:23", "02/28 01:10", "03/02 21:21", "03/03 23:59", "03/04 23:10", "03/05 21:16", "03/06 22:50", "03/07 05:18", "03/09 20:47", "03/10 22:45", "03/11 20:59", "03/12 22:15", "03/13 22:53", "03/14 20:47", "03/16 22:10", "03/17 22:22", "03/18 22:36", "03/19 23:07", "03/20 21:36", "03/23 16:25", "03/24 18:48", "03/25 22:07", "03/26 23:36", "03/27 18:51", "03/30 22:35 (PR)"]
  y-axis "Size (GB)" 0 --> 0.5
  line "account-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "authorization-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "ddp-streamer-service" [0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.12]
  line "omnichannel-transcript-service" [0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "presence-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "queue-worker-service" [0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "rocketchat" [0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.33, 0.33, 0.33, 0.33, 0.33, 0.33, 0.33, 0.33, 0.33, 0.33, 0.33, 0.33, 0.33, 0.40, 0.40, 0.40, 0.40, 0.40, 0.40, 0.40, 0.40, 0.40, 0.40, 0.40, 0.35]
Loading

Statistics (last 30 days):

  • 📊 Average: 1.5GiB
  • ⬇️ Minimum: 1.4GiB
  • ⬆️ Maximum: 1.6GiB
  • 🎯 Current PR: 1.1GiB
ℹ️ About this report

This report compares Docker image sizes from this build against the develop baseline.

  • Tag: pr-36810
  • Baseline: develop
  • Timestamp: 2026-03-30 22:35:55 UTC
  • Historical data points: 30

Updated: Mon, 30 Mar 2026 22:35:56 GMT

@jessicaschelly
jessicaschelly changed the base branch from chore/ldap/tests to develop August 7, 2026 19:51
@jessicaschelly
jessicaschelly force-pushed the test/ldap-tests branch 4 times, most recently from 0079df6 to bbab67a Compare August 7, 2026 21:00
@jessicaschelly
jessicaschelly marked this pull request as ready for review August 10, 2026 12:39

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
apps/meteor/tests/e2e/ldap.spec.ts (1)

113-133: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use test names that state the expected result.

connection, user search, and login using LDAP credentials describe scope or action. Rename them to state the expected behavior, such as successful connection, returned LDAP user, and successful mapped login.

As per coding guidelines, “Use descriptive test names that clearly communicate expected behavior in Playwright tests.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/meteor/tests/e2e/ldap.spec.ts` around lines 113 - 133, Rename the
Playwright tests around the connection, user search, and LDAP login flows to
describe their expected outcomes rather than their actions. Update the test
names in the connection and user-search cases, and the following login test, to
clearly state successful connection, successful LDAP user retrieval, and
successful mapped login.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/meteor/tests/e2e/ldap.spec.ts`:
- Around line 124-130: Update the LDAP test around the /ldap.testSearch request
to validate that the login flow returns the expected ldap.e2e user, rather than
asserting only result.success. Use the login response’s returned user data or an
admin-users endpoint to assert ldap.e2e is present, while preserving the
existing successful-response check.

---

Nitpick comments:
In `@apps/meteor/tests/e2e/ldap.spec.ts`:
- Around line 113-133: Rename the Playwright tests around the connection, user
search, and LDAP login flows to describe their expected outcomes rather than
their actions. Update the test names in the connection and user-search cases,
and the following login test, to clearly state successful connection, successful
LDAP user retrieval, and successful mapped login.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1e06c187-84b4-4d2c-b56f-8a6a7c82b176

📥 Commits

Reviewing files that changed from the base of the PR and between a9f3e6c and 696f338.

⛔ Files ignored due to path filters (1)
  • apps/meteor/tests/e2e/ldap.spec.ts-snapshots/ldap-avatar-linux.jpeg is excluded by !**/*.jpeg
📒 Files selected for processing (2)
  • apps/meteor/tests/e2e/ldap.spec.ts
  • development/ldap/02-data.ldif
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Hacktron Security Check
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{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/e2e/ldap.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/e2e/ldap.spec.ts
apps/meteor/tests/e2e/**/*.spec.ts

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

apps/meteor/tests/e2e/**/*.spec.ts: All test files must be created in apps/meteor/tests/e2e/ directory
Avoid using page.locator() in Playwright tests - always prefer semantic locators such as page.getByRole(), page.getByLabel(), page.getByText(), or page.getByTitle()
Use test.beforeAll() and test.afterAll() for setup/teardown in Playwright tests
Use test.step() for complex test scenarios to improve organization in Playwright tests
Group related tests in the same file
Utilize Playwright fixtures (test, page, expect) for consistency in test files
Prefer web-first assertions (toBeVisible, toHaveText, etc.) in Playwright tests
Use expect matchers for assertions (toEqual, toContain, toBeTruthy, toHaveLength, etc.) instead of assert statements in Playwright tests
Use page.waitFor() with specific conditions instead of hardcoded timeouts in Playwright tests
Implement proper wait strategies for dynamic content in Playwright tests
Maintain test isolation between test cases in Playwright tests
Ensure clean state for each test execution in Playwright tests
Ensure tests run reliably in parallel without shared state conflicts

Files:

  • apps/meteor/tests/e2e/ldap.spec.ts
apps/meteor/tests/e2e/**/*.{ts,spec.ts}

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

apps/meteor/tests/e2e/**/*.{ts,spec.ts}: Store commonly used locators in variables/constants for reuse
Follow Page Object Model pattern consistently in Playwright tests

Files:

  • apps/meteor/tests/e2e/ldap.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/e2e/ldap.spec.ts
🧠 Learnings (6)
📚 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/e2e/ldap.spec.ts
📚 Learning: 2026-02-24T19:39:42.247Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/page-objects/fragments/message.ts:7-7
Timestamp: 2026-02-24T19:39:42.247Z
Learning: In RocketChat e2e tests, avoid using data-qa attributes to locate elements. Prefer semantic locators such as getByRole, getByLabel, getByText, getByTitle and ARIA-based selectors. Apply this rule to all TypeScript files under apps/meteor/tests/e2e to improve test reliability, accessibility, and maintainability.

Applied to files:

  • apps/meteor/tests/e2e/ldap.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/e2e/ldap.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/e2e/ldap.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/e2e/ldap.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/e2e/ldap.spec.ts
🔇 Additional comments (3)
apps/meteor/tests/e2e/ldap.spec.ts (2)

18-77: LGTM!


79-111: 🩺 Stability & Availability

No change needed for LDAP cross-worker exclusion.

apps/meteor/playwright.config.ts sets workers: 1, and ldap.spec.ts is the only tracked file under apps/meteor/tests/e2e/ that mutates LDAP settings.

development/ldap/02-data.ldif (1)

20-35: LGTM!

Comment thread apps/meteor/tests/e2e/ldap.spec.ts Outdated

@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 3 files

Re-trigger cubic

@jessicaschelly jessicaschelly added this to the 8.8.0 milestone Aug 10, 2026
@jessicaschelly jessicaschelly added the stat: QA assured Means it has been tested and approved by a company insider label Aug 17, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Aug 17, 2026
Comment thread apps/meteor/tests/e2e/ldap.spec.ts Outdated
},
{
message: 'LDAP settings did not propagate to the running server',
timeout: 15_000,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🥶 really needed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I checked the saveSettings, and it waits for the database updates but not for the settings notifications to finish. Since we test the LDAP connection right after that, it might still read the old settings on slower runs, so I thought it would be better to keep it, since without it the poll would use Playwright’s default 5-second timeout, wdyt?

Comment thread apps/meteor/tests/e2e/ldap.spec.ts Outdated
Comment thread apps/meteor/tests/e2e/ldap.spec.ts Outdated
Comment on lines +107 to +125
test('connection', async ({ api }) => {
await test.step('expect to successfully execute a connection test', async () => {
const response = await api.post('/ldap.testConnection', {});
expect(response.status()).toBe(200);
const result = await response.json();
expect(result.success).toBe(true);
});
});

test('user search', async ({ api }) => {
await test.step('expect to successfully search for LDAP users', async () => {
const response = await api.post('/ldap.testSearch', {
username: ldapUsername,
});
expect(response.status()).toBe(200);
const result = await response.json();
expect(result.success).toBe(true);
expect(result.message).toBe('LDAP_User_Found');
});

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is testing just the API, why we're doing through playwright?

Comment thread apps/meteor/tests/e2e/ldap.spec.ts Outdated
Comment thread apps/meteor/tests/e2e/ldap.spec.ts Outdated
Comment on lines +140 to +148
await test.step('expect LDAP user data to have been mapped to the correct fields', async () => {
const user = await getUserInfo(api, ldapUsername);

expect(user).toBeDefined();
expect(user?.username).toBe(ldapUsername);
expect(user?.name).toBe('LDAP E2E');
expect(user?.emails).toBeDefined();
expect(user?.emails?.[0].address).toBe('ldap.e2e@space.air');
});

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

again an API test, not much value doing through playwright

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

hmm, yes, I considered moving it, but the API suite would also need the LDAP settings setup and restoration since rc isn’t configured to use it there, I thought keeping these checks here might be simpler and keep it similar to saml, but let me know what you think!

Comment thread apps/meteor/tests/e2e/ldap.spec.ts Outdated

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

All reported issues were addressed across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread apps/meteor/tests/e2e/ldap.spec.ts Outdated
@jessicaschelly jessicaschelly removed the stat: QA assured Means it has been tested and approved by a company insider label Aug 18, 2026
@dionisio-bot dionisio-bot Bot removed the stat: ready to merge PR tested and approved waiting for merge label Aug 18, 2026
@scuciatto scuciatto modified the milestones: 8.8.0, 8.9.0 Aug 24, 2026
@jessicaschelly
jessicaschelly requested a review from a team as a code owner September 2, 2026 16:46
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.

4 participants