Skip to content

Conversation

@Harmeet221
Copy link
Contributor

@Harmeet221 Harmeet221 commented Sep 4, 2025

JIRA TASK: https://rocketchat.atlassian.net/browse/QA-103

The automated test includes the application of tags for a specific room. It covers following scenarios:

  • Visitor associated with departmentA
  • should be allowed to select tags specific to departmentA
  • Should be allowed to select public tags
  • Should be allowed to select shared tags i.e associated with departmentA as well as departmentB
  • Should not be allowed to see tags associated with departmentB

Agent associated with multiple department and visitor associated with departmentB

  • Should be able to select tags associated with departmentB
  • Should not be able to see tags associated with departmentA

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Bug Fixes

    • Improved accessibility of Tags in Omnichannel room info by adding unique per-room identifiers and rendering tags as a semantic, labeled list for better screen-reader support. No visual changes.
  • Tests

    • Added end-to-end tests for omnichannel tag visibility and selection across department-specific, shared, and global tags.
    • Extended room-info test utilities to select and validate tag options.

@Harmeet221 Harmeet221 requested a review from a team as a code owner September 4, 2025 13:49
@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Sep 4, 2025

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

  • This PR is targeting the wrong base branch. It should target 7.12.0, but it targets 7.11.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Sep 4, 2025

⚠️ No Changeset found

Latest commit: 2b0a402

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

@Harmeet221 Harmeet221 marked this pull request as draft September 4, 2025 13:50
@codecov
Copy link

codecov bot commented Sep 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.29%. Comparing base (48d1442) to head (2b0a402).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #36869      +/-   ##
===========================================
- Coverage    67.36%   66.29%   -1.08%     
===========================================
  Files         3330     3383      +53     
  Lines       113482   115648    +2166     
  Branches     20604    21332     +728     
===========================================
+ Hits         76449    76670     +221     
- Misses       34424    36363    +1939     
- Partials      2609     2615       +6     
Flag Coverage Δ
e2e 57.30% <100.00%> (+0.03%) ⬆️
unit 71.14% <ø> (-0.02%) ⬇️

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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 24, 2025

Walkthrough

Renders room tags as a semantic, accessible list tied to room._id; adds enterprise-gated e2e tests for department-scoped tag visibility and assignment; extends the OmnichannelRoomInfo page object with tag-selection helpers for tests.

Changes

Cohort / File(s) Summary
ChatInfo accessibility & semantics
apps/meteor/client/views/omnichannel/directory/chats/ChatInfo/ChatInfo.tsx
Destructures room._id as roomId; adds id for the Tags label; wraps tags in a ul with aria-labelledby and renders each tag as an li (Box is='li') containing a disabled Tag.
E2E: omnichannel tag visibility & assignment
apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
Adds an enterprise-gated e2e suite that creates departments, agent, tags, and conversations; verifies department-scoped tag visibility, selects/saves tags via Room Info, and asserts persisted tags in room details.
E2E page object: tag helpers
apps/meteor/tests/e2e/page-objects/omnichannel-room-info.ts
Adds inputTags getter, optionTags(name) locator, selectTag(name) action, and getTagInfoByLabel(label) locator to interact with tag input/options in the Omnichannel Room Info dialog.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Agent
  participant UI as Omnichannel UI
  participant BE as Server
  participant Rules as Dept/Tag Rules

  Agent->>UI: Open Room Info (uses `roomId`)
  UI->>BE: Request room + allowed tags
  BE->>Rules: Apply department/shared/public filters
  Rules-->>BE: Return allowed tags
  BE-->>UI: Allowed tags list
  Note right of UI #DDEBF7: Render tags as semantic list\n<ul aria-labelledby="..."> with `li` items
  UI-->>Agent: Show allowed tags list

  Agent->>UI: Select tag options
  UI->>BE: Save selected tags
  BE->>Rules: Validate selections
  Rules-->>BE: Confirm
  BE-->>UI: Persisted tags
  UI-->>Agent: Show updated tags in room info
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

In a burrow of rooms I hop and I write,
Tags now in lists, each id tucked tight.
Agents choose, the server checks the door,
Shared, global, some hidden evermore.
A rabbit cheeps — tests pass, all is light.

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Linked Issues Check ⚠️ Warning The end-to-end tests cover agent scenarios for department A and B tag visibility and selection, but they do not implement the visitor-associated scenarios required by QA-103 and thus fail to verify tag visibility constraints for visitors linked to specific departments. Add automated test scenarios for visitors associated with department A to ensure that department-specific, public, and shared tags are visible and that department B-exclusive tags are hidden, as outlined in the linked issue QA-103.
Out of Scope Changes Check ⚠️ Warning The application code in ChatInfo.tsx has been updated to add accessibility identifiers and convert tag rendering to a semantic list, which is outside the scope of the linked QA-103 issue that focuses solely on test coverage for department-based tag visibility. Isolate UI changes to a separate pull request or explicitly include them in the objectives if they are required to support testability, ensuring that test code and application code modifications are clearly scoped.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title references adding tags to a room, which is a genuine aspect of the changeset, but it does not clearly convey that this pull request introduces end-to-end tests for omnichannel tag assignment and department-based visibility.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch tags-implementation

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.

@Harmeet221 Harmeet221 marked this pull request as ready for review September 24, 2025 14:33
Copy link
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.

Actionable comments posted: 2

🧹 Nitpick comments (6)
apps/meteor/client/views/omnichannel/directory/chats/ChatInfo/ChatInfo.tsx (1)

125-136: Make the tag list bulletless, keep tags inline, and guard ARIA id when roomId is missing.

Prevents default bullets and minor a11y edge case when roomId is undefined; also drops unnecessary inline style on Tag.

Apply this diff:

-							<InfoPanelLabel id={`${roomId}-tags`}>{t('Tags')}</InfoPanelLabel>
+							<InfoPanelLabel id={roomId ? `${roomId}-tags` : 'room-tags'}>{t('Tags')}</InfoPanelLabel>
 							<InfoPanelText>
-								<ul aria-labelledby={`${roomId}-tags`}>
+								<Box
+									is='ul'
+									aria-labelledby={roomId ? `${roomId}-tags` : 'room-tags'}
+									p={0}
+									m={0}
+									style={{ listStyle: 'none' }}
+								>
 									{tags.map((tag) => (
 										<Box is='li' key={tag} mie={4} display='inline'>
-											<Tag style={{ display: 'inline' }} disabled>
+											<Tag disabled>
 												{tag}
 											</Tag>
 										</Box>
 									))}
-								</ul>
+								</Box>
apps/meteor/tests/e2e/page-objects/omnichannel-room-info.ts (2)

56-58: Scope and strengthen the Tags input locator.

Rely on the field label within the Edit Room dialog instead of placeholder text; this is more stable and avoids cross-page collisions.

Apply this diff:

-	get inputTags(): Locator {
-		return this.page.getByRole('textbox', { name: 'Select an option' });
-	}
+	get inputTags(): Locator {
+		return this.dialogEditRoom.getByLabel('Tags');
+	}

68-70: Avoid substring matches when asserting tag chips in the list.

Use exact text matching to prevent false positives (e.g., Tag vs TagA).

Apply this diff:

-	getTagInfoByLabel(label: string): Locator {
-		return this.dialogRoomInfo.getByRole('list', { name: 'Tags' }).getByText(label);
-	}
+	getTagInfoByLabel(label: string): Locator {
+		return this.dialogRoomInfo.getByRole('list', { name: 'Tags' }).getByText(label, { exact: true });
+	}
apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts (3)

27-45: Optional: remove inline comments from tests per repo guidelines.

Keeps e2e code concise and consistent with the project’s no-comments preference for test implementations.


69-75: Optional: wait for the Edit Room dialog before interacting.

Add a web-first assertion to stabilize interactions under load.

You can insert this just after clicking Edit:

await expect(poOmnichannel.roomInfo.dialogEditRoom).toBeVisible();

76-90: Visibility-negative assertions can be flaky; consider presence checks.

When asserting non-visibility of TagB, also assert the listbox/options are rendered to avoid false passes due to missing overlay.

Example:

await expect(poOmnichannel.roomInfo.optionTags('TagA')).toBeVisible();
await expect(poOmnichannel.roomInfo.optionTags('TagB')).not.toBeVisible();
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between f00d157 and e7decf3.

📒 Files selected for processing (3)
  • apps/meteor/client/views/omnichannel/directory/chats/ChatInfo/ChatInfo.tsx (2 hunks)
  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts (1 hunks)
  • apps/meteor/tests/e2e/page-objects/omnichannel-room-info.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
apps/meteor/tests/e2e/page-objects/**/*.ts

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

Utilize and place Page Object implementations under apps/meteor/tests/e2e/page-objects/

Files:

  • apps/meteor/tests/e2e/page-objects/omnichannel-room-info.ts
apps/meteor/tests/e2e/**/*.{ts,tsx,js,jsx}

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

apps/meteor/tests/e2e/**/*.{ts,tsx,js,jsx}: Write concise, technical TypeScript/JavaScript with accurate typing
Follow DRY by extracting reusable logic into helper functions or page objects
Avoid code comments in the implementation

Files:

  • apps/meteor/tests/e2e/page-objects/omnichannel-room-info.ts
  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
apps/meteor/tests/e2e/**/*.{ts,tsx}

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

apps/meteor/tests/e2e/**/*.{ts,tsx}: Avoid using page.locator(); prefer semantic locators like page.getByRole, page.getByLabel, page.getByText, and page.getByTitle
Store commonly used locators in variables/constants for reuse
Use page.waitFor() with specific conditions and avoid hardcoded timeouts
Implement proper wait strategies for dynamic content
Follow the Page Object Model pattern consistently

Files:

  • apps/meteor/tests/e2e/page-objects/omnichannel-room-info.ts
  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
apps/meteor/tests/e2e/**/*.spec.ts

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

apps/meteor/tests/e2e/**/*.spec.ts: All Playwright test files must be located under apps/meteor/tests/e2e/ and use the .spec.ts extension (e.g., login.spec.ts)
Use descriptive test names that clearly communicate expected behavior
Use test.beforeAll() and test.afterAll() for setup and teardown
Use test.step() to organize complex test scenarios
Group related tests in the same file
Utilize Playwright fixtures (test, page, expect) consistently
Prefer web-first assertions (e.g., toBeVisible, toHaveText)
Use expect matchers (toEqual, toContain, toBeTruthy, toHaveLength, etc.) instead of assert statements
Maintain test isolation between test cases
Ensure a clean state for each test execution
Ensure tests run reliably in parallel without shared state conflicts

Files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
🧠 Learnings (6)
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,tsx} : Avoid using page.locator(); prefer semantic locators like page.getByRole, page.getByLabel, page.getByText, and page.getByTitle

Applied to files:

  • apps/meteor/tests/e2e/page-objects/omnichannel-room-info.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/page-objects/**/*.ts : Utilize and place Page Object implementations under apps/meteor/tests/e2e/page-objects/

Applied to files:

  • apps/meteor/tests/e2e/page-objects/omnichannel-room-info.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,tsx} : Store commonly used locators in variables/constants for reuse

Applied to files:

  • apps/meteor/tests/e2e/page-objects/omnichannel-room-info.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,tsx} : Follow the Page Object Model pattern consistently

Applied to files:

  • apps/meteor/tests/e2e/page-objects/omnichannel-room-info.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use descriptive test names that clearly communicate expected behavior

Applied to files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Maintain test isolation between test cases

Applied to files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
🧬 Code graph analysis (1)
apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts (3)
apps/meteor/tests/mocks/data.ts (1)
  • createFakeVisitor (309-314)
apps/meteor/tests/e2e/page-objects/home-omnichannel.ts (1)
  • HomeOmnichannel (14-67)
apps/meteor/tests/data/livechat/rooms.ts (1)
  • createAgent (198-212)
🔇 Additional comments (3)
apps/meteor/client/views/omnichannel/directory/chats/ChatInfo/ChatInfo.tsx (1)

56-56: Good: clearer aliasing of room id.

Destructuring _id into roomId improves readability and makes the ARIA linkage clearer downstream.

apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts (2)

31-35: Verify agent creation/idempotency and downstream identifiers.

You’re upgrading user1 to agent and later referencing agentId: 'user1'. Ensure:

  • createAgent(api, 'user1') is idempotent across parallel suites.
  • addAgentToDepartment expects the identifier you pass (username vs userId). Prefer passing the exact identifier returned by createAgent.

98-103: LGTM: verifies persisted tags via semantic list.

Asserting via the labeled list matches the new accessible structure in ChatInfo.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 25, 2025

Note

Unit test generation is an Early Access feature. Expect some limitations and changes as we gather feedback and continue to improve it.


Generating unit tests... This may take up to 20 minutes.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 25, 2025

Caution

CodeRabbit plans did not produce any file changes.

Copy link
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.

Actionable comments posted: 0

🧹 Nitpick comments (8)
apps/meteor/tests/e2e/page-objects/omnichannel-room-info.ts (3)

56-58: Scope the tags input to the edit dialog and use a stable accessible name.

Relying on "Select an option" is brittle and not dialog-scoped. Prefer the labeled control inside Edit Room.

Apply this diff:

-	get inputTags(): Locator {
-		return this.page.getByRole('textbox', { name: 'Select an option' });
-	}
+	get inputTags(): Locator {
+		return this.dialogEditRoom.getByLabel('Tags');
+	}

60-62: Scope option lookup to the open listbox to avoid cross-dialog matches.

Unscoped page-level option queries can collide with other menus.

Apply this diff:

-	optionTags(name: string): Locator {
-		return this.page.getByRole('option', { name, exact: true });
-	}
+	optionTags(name: string): Locator {
+		return this.page.getByRole('listbox').getByRole('option', { name, exact: true });
+	}

64-66: Ensure the dropdown is open before selecting an option.

The menu may close after a selection; opening it before clicking improves reliability.

Apply this diff:

-	async selectTag(name: string): Promise<void> {
-		await this.optionTags(name).click();
-	}
+	async selectTag(name: string): Promise<void> {
+		await this.inputTags.click();
+		await this.optionTags(name).click();
+	}
apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts (5)

35-39: Don’t await inside Promise.all; pass promises directly.

Current code serializes the calls and defeats concurrency.

Apply this diff:

-	test.beforeAll('Add agents to departments', async ({ api }) => {
-		await Promise.all([
-			await addAgentToDepartment(api, { department: departmentA.data, agentId: 'user1' }),
-			await addAgentToDepartment(api, { department: departmentB.data, agentId: 'user1' }),
-		]);
-	});
+	test.beforeAll('Add agents to departments', async ({ api }) => {
+		await Promise.all([
+			addAgentToDepartment(api, { department: departmentA.data, agentId: 'user1' }),
+			addAgentToDepartment(api, { department: departmentB.data, agentId: 'user1' }),
+		]);
+	});

88-92: Wait for the Edit Room dialog before interacting with the tags input.

Avoid racing the dialog opening.

Apply this diff:

 		await test.step('check available tags', async () => {
 			await poOmnichannel.roomInfo.btnEditRoomInfo.click();
+			await expect(poOmnichannel.roomInfo.dialogEditRoom).toBeVisible();
 			await poOmnichannel.roomInfo.inputTags.click();
 		});

109-113: Reopen the dropdown before selecting the second tag.

Many multiselects close after a selection; reopening avoids flakes.

Apply this diff:

 		await test.step('add tags and save', async () => {
 			await poOmnichannel.roomInfo.selectTag('TagA');
+			await poOmnichannel.roomInfo.inputTags.click();
 			await poOmnichannel.roomInfo.selectTag('GlobalTag');
 			await poOmnichannel.roomInfo.btnSaveEditRoom.click();
 		});

122-127: Also wait for the Edit Room dialog in the second scenario.

Mirror the wait used above for consistency and stability.

Apply this diff:

 		await test.step('Open room info', async () => {
 			await poOmnichannel.sidenav.getSidebarItemByName(visitorB.name).click();
 			await poOmnichannel.roomInfo.btnEditRoomInfo.click();
+			await expect(poOmnichannel.roomInfo.dialogEditRoom).toBeVisible();
 			await poOmnichannel.roomInfo.inputTags.click();
 		});

27-29: Optional: add a unique slug to names to avoid cross-test collisions.

Static names (Department A/B, TagA/B, GlobalTag, SharedTag) risk collisions when suites run in parallel.

Example (no diff, pattern only):

  • const slug = Date.now().toString(36).slice(-4);
  • Department A → Department A - ${slug}
  • TagA → TagA-${slug}, etc.

Also applies to: 44-51, 56-59

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 58c6a2b and 7f49492.

📒 Files selected for processing (2)
  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts (1 hunks)
  • apps/meteor/tests/e2e/page-objects/omnichannel-room-info.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
apps/meteor/tests/e2e/**/*.spec.ts

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

apps/meteor/tests/e2e/**/*.spec.ts: All Playwright test files must be located under apps/meteor/tests/e2e/ and use the .spec.ts extension (e.g., login.spec.ts)
Use descriptive test names that clearly communicate expected behavior
Use test.beforeAll() and test.afterAll() for setup and teardown
Use test.step() to organize complex test scenarios
Group related tests in the same file
Utilize Playwright fixtures (test, page, expect) consistently
Prefer web-first assertions (e.g., toBeVisible, toHaveText)
Use expect matchers (toEqual, toContain, toBeTruthy, toHaveLength, etc.) instead of assert statements
Maintain test isolation between test cases
Ensure a clean state for each test execution
Ensure tests run reliably in parallel without shared state conflicts

Files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
apps/meteor/tests/e2e/**/*.{ts,tsx,js,jsx}

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

apps/meteor/tests/e2e/**/*.{ts,tsx,js,jsx}: Write concise, technical TypeScript/JavaScript with accurate typing
Follow DRY by extracting reusable logic into helper functions or page objects
Avoid code comments in the implementation

Files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
  • apps/meteor/tests/e2e/page-objects/omnichannel-room-info.ts
apps/meteor/tests/e2e/**/*.{ts,tsx}

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

apps/meteor/tests/e2e/**/*.{ts,tsx}: Avoid using page.locator(); prefer semantic locators like page.getByRole, page.getByLabel, page.getByText, and page.getByTitle
Store commonly used locators in variables/constants for reuse
Use page.waitFor() with specific conditions and avoid hardcoded timeouts
Implement proper wait strategies for dynamic content
Follow the Page Object Model pattern consistently

Files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
  • apps/meteor/tests/e2e/page-objects/omnichannel-room-info.ts
apps/meteor/tests/e2e/page-objects/**/*.ts

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

Utilize and place Page Object implementations under apps/meteor/tests/e2e/page-objects/

Files:

  • apps/meteor/tests/e2e/page-objects/omnichannel-room-info.ts
🧠 Learnings (13)
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use descriptive test names that clearly communicate expected behavior

Applied to files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure a clean state for each test execution

Applied to files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure tests run reliably in parallel without shared state conflicts

Applied to files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Utilize Playwright fixtures (test, page, expect) consistently

Applied to files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,tsx} : Follow the Page Object Model pattern consistently

Applied to files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Maintain test isolation between test cases

Applied to files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,tsx} : Avoid using page.locator(); prefer semantic locators like page.getByRole, page.getByLabel, page.getByText, and page.getByTitle

Applied to files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
  • apps/meteor/tests/e2e/page-objects/omnichannel-room-info.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use test.beforeAll() and test.afterAll() for setup and teardown

Applied to files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use test.step() to organize complex test scenarios

Applied to files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Group related tests in the same file

Applied to files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: When generating tests, provide complete runnable TypeScript test files with proper imports, clear describe/test blocks, and adherence to these guidelines

Applied to files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/page-objects/**/*.ts : Utilize and place Page Object implementations under apps/meteor/tests/e2e/page-objects/

Applied to files:

  • apps/meteor/tests/e2e/page-objects/omnichannel-room-info.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,tsx} : Store commonly used locators in variables/constants for reuse

Applied to files:

  • apps/meteor/tests/e2e/page-objects/omnichannel-room-info.ts
🧬 Code graph analysis (1)
apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts (3)
apps/meteor/tests/mocks/data.ts (1)
  • createFakeVisitor (309-314)
apps/meteor/tests/e2e/page-objects/home-omnichannel.ts (1)
  • HomeOmnichannel (14-67)
packages/core-typings/src/utils.ts (1)
  • Awaited (9-9)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: Builds matrix rust bindings against alpine
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🔇 Additional comments (3)
apps/meteor/tests/e2e/page-objects/omnichannel-room-info.ts (1)

68-70: LGTM: semantic locator for tag pill in room info.

Using role=list with an accessible name is aligned with our guidelines.

apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts (2)

84-87: Verify ‘Tags’ section visibility — assertion likely inverted with new UI.

If ChatInfo now always renders a semantic Tags list in Room Information, this should assert visible (even when empty).

Apply this diff if the list is expected to be present:

-		await test.step('should not be able to see tags field', async () => {
-			await expect(poOmnichannel.roomInfo.getInfoByLabel('Tags')).not.toBeVisible();
-		});
+		await test.step('Tags section is present before editing', async () => {
+			await expect(poOmnichannel.roomInfo.getInfoByLabel('Tags')).toBeVisible();
+		});

If the UI intentionally hides the section when empty, keep the negative check; please confirm against ChatInfo.tsx.


67-69: Remove manual closing of Playwright’s page fixture.

The runner manages lifecycle; closing it can break other tests in the same worker.

Apply this diff:

-	test.afterEach(async () => {
-		await poOmnichannel.page.close();
-	});
+	// Do not manually close the page fixture; the runner manages it.

Copy link
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.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 7f49492 and 79b008c.

📒 Files selected for processing (1)
  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
apps/meteor/tests/e2e/**/*.spec.ts

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

apps/meteor/tests/e2e/**/*.spec.ts: All Playwright test files must be located under apps/meteor/tests/e2e/ and use the .spec.ts extension (e.g., login.spec.ts)
Use descriptive test names that clearly communicate expected behavior
Use test.beforeAll() and test.afterAll() for setup and teardown
Use test.step() to organize complex test scenarios
Group related tests in the same file
Utilize Playwright fixtures (test, page, expect) consistently
Prefer web-first assertions (e.g., toBeVisible, toHaveText)
Use expect matchers (toEqual, toContain, toBeTruthy, toHaveLength, etc.) instead of assert statements
Maintain test isolation between test cases
Ensure a clean state for each test execution
Ensure tests run reliably in parallel without shared state conflicts

Files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
apps/meteor/tests/e2e/**/*.{ts,tsx,js,jsx}

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

apps/meteor/tests/e2e/**/*.{ts,tsx,js,jsx}: Write concise, technical TypeScript/JavaScript with accurate typing
Follow DRY by extracting reusable logic into helper functions or page objects
Avoid code comments in the implementation

Files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
apps/meteor/tests/e2e/**/*.{ts,tsx}

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

apps/meteor/tests/e2e/**/*.{ts,tsx}: Avoid using page.locator(); prefer semantic locators like page.getByRole, page.getByLabel, page.getByText, and page.getByTitle
Store commonly used locators in variables/constants for reuse
Use page.waitFor() with specific conditions and avoid hardcoded timeouts
Implement proper wait strategies for dynamic content
Follow the Page Object Model pattern consistently

Files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
🧠 Learnings (11)
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use descriptive test names that clearly communicate expected behavior

Applied to files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure a clean state for each test execution

Applied to files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure tests run reliably in parallel without shared state conflicts

Applied to files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Utilize Playwright fixtures (test, page, expect) consistently

Applied to files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,tsx} : Follow the Page Object Model pattern consistently

Applied to files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Maintain test isolation between test cases

Applied to files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,tsx} : Avoid using page.locator(); prefer semantic locators like page.getByRole, page.getByLabel, page.getByText, and page.getByTitle

Applied to files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use test.beforeAll() and test.afterAll() for setup and teardown

Applied to files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use test.step() to organize complex test scenarios

Applied to files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Group related tests in the same file

Applied to files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: When generating tests, provide complete runnable TypeScript test files with proper imports, clear describe/test blocks, and adherence to these guidelines

Applied to files:

  • apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts
🧬 Code graph analysis (1)
apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts (3)
apps/meteor/tests/mocks/data.ts (1)
  • createFakeVisitor (309-314)
apps/meteor/tests/e2e/page-objects/home-omnichannel.ts (1)
  • HomeOmnichannel (14-67)
packages/core-typings/src/utils.ts (1)
  • Awaited (9-9)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🔇 Additional comments (1)
apps/meteor/tests/e2e/omnichannel/omnichannel-assign-room-tags.spec.ts (1)

127-133: Assert Department‑B tag can actually be assigned

The second scenario only checks that TagB is visible; it never selects or saves it, so a regression in the assignment flow would go unnoticed even though the test “passes.” Add a step that selects TagB, clicks save, and asserts the tag appears in room info (mirroring the first test’s verification). For instance:

 		await test.step('Agent associated with DepartmentB should not be able to see tags for DepartmentA', async () => {
 			await expect(poOmnichannel.roomInfo.optionTags('TagA')).not.toBeVisible();
 		});
+
+		await test.step('Agent can assign DepartmentB tag to the room', async () => {
+			await poOmnichannel.roomInfo.selectTag('TagB');
+			await poOmnichannel.roomInfo.btnSaveEditRoom.click();
+			await expect(poOmnichannel.roomInfo.getTagInfoByLabel('TagB')).toBeVisible();
+		});

(Use the dynamic tag name variable once added.) Based on learnings.

@aleksandernsilva aleksandernsilva added this to the 7.11.0 milestone Sep 26, 2025
@aleksandernsilva aleksandernsilva added the stat: QA assured Means it has been tested and approved by a company insider label Sep 26, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Sep 26, 2025
@dionisio-bot dionisio-bot bot removed the stat: ready to merge PR tested and approved waiting for merge label Sep 26, 2025
@dougfabris dougfabris modified the milestones: 7.11.0, 7.12.0 Sep 29, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Sep 29, 2025
@kodiakhq kodiakhq bot merged commit 5e821ad into develop Sep 29, 2025
85 of 88 checks passed
@kodiakhq kodiakhq bot deleted the tags-implementation branch September 29, 2025 17:51
ricardogarim pushed a commit that referenced this pull request Oct 6, 2025
Co-authored-by: Aleksander Nicacio da Silva <[email protected]>
ricardogarim pushed a commit that referenced this pull request Oct 6, 2025
Co-authored-by: Aleksander Nicacio da Silva <[email protected]>
debdutdeb pushed a commit that referenced this pull request Oct 7, 2025
Co-authored-by: Aleksander Nicacio da Silva <[email protected]>
sampaiodiego pushed a commit that referenced this pull request Oct 7, 2025
Co-authored-by: Aleksander Nicacio da Silva <[email protected]>
juliajforesti pushed a commit that referenced this pull request Oct 8, 2025
Co-authored-by: Aleksander Nicacio da Silva <[email protected]>
juliajforesti pushed a commit that referenced this pull request Oct 8, 2025
Co-authored-by: Aleksander Nicacio da Silva <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants