Skip to content

fix: test button not playing default sound in notification preferences#40335

Merged
dionisio-bot[bot] merged 5 commits into
developfrom
fix/sound-reproduction-for-default
May 4, 2026
Merged

fix: test button not playing default sound in notification preferences#40335
dionisio-bot[bot] merged 5 commits into
developfrom
fix/sound-reproduction-for-default

Conversation

@nazabucciarelli
Copy link
Copy Markdown
Contributor

@nazabucciarelli nazabucciarelli commented Apr 29, 2026

Proposed changes (including videos or screenshots)

  • Added fallback to newMessageNotification user preference when trying to play the default sound.
  • Added unit tests.

Issue(s)

SUP-1027 "test sound" button don't work for Default

Steps to test or reproduce

1- Be logged in as any user
2- Go to any room
3- Click on kebab menu (options)
4- Click notification preferences
5- Under the Desktop section, select the Default option in the Sound dropdown and click on the play button

Further comments

Summary by CodeRabbit

  • Bug Fixes

    • Play button in Notification Preferences now resolves the desktop "default" sound to the user's selected notification sound (unless a specific desktop sound is chosen) and includes an accessible "Play" label.
  • Tests

    • Added tests validating play-button behavior for default resolution, user-preference usage, and explicit desktop sound selection.

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot Bot commented Apr 29, 2026

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 29, 2026

🦋 Changeset detected

Latest commit: e7bc5a1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 41 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/http-router Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/models Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/ui-voip Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/abac Patch
@rocket.chat/federation-matrix Patch
@rocket.chat/license Patch
@rocket.chat/media-calls Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/network-broker Patch
@rocket.chat/omni-core-ee Patch
@rocket.chat/mock-providers Patch
@rocket.chat/instance-status Patch
@rocket.chat/omni-core Patch
@rocket.chat/server-fetch Patch
@rocket.chat/ui-video-conf Patch

Not sure what this means? Click here to learn what changesets are.

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 29, 2026

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

Run ID: e1d61a8d-ebab-4a56-8b80-0172a8fd0161

📥 Commits

Reviewing files that changed from the base of the PR and between dd9f430 and e7bc5a1.

📒 Files selected for processing (2)
  • apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesForm.tsx
  • apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx
✅ Files skipped from review due to trivial changes (1)
  • apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesForm.tsx
📜 Recent review details
⏰ 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 context used
📓 Path-based instructions (1)
**/*.{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/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx
🧠 Learnings (2)
📚 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/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx
📚 Learning: 2026-03-27T14:52:56.865Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39892
File: apps/meteor/client/views/room/contextualBar/Threads/Thread.tsx:150-155
Timestamp: 2026-03-27T14:52:56.865Z
Learning: In Rocket.Chat, there are two different `ModalBackdrop` components with different prop APIs. During review, confirm the import source: (1) `rocket.chat/fuselage` `ModalBackdrop` uses `ModalBackdropProps` based on `BoxProps` (so it supports `onClick` and other Box/DOM props) and does not have an `onDismiss` prop; (2) `rocket.chat/ui-client` `ModalBackdrop` uses a narrower props interface like `{ children?: ReactNode; onDismiss?: () => void }` and handles Escape keypress and outside mouse-up, and it does not forward arbitrary DOM props such as `onClick`. Flag mismatched props (e.g., `onDismiss` passed to the fuselage component or `onClick` passed to the ui-client component) and ensure the usage matches the correct component being imported.

Applied to files:

  • apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx
🔇 Additional comments (2)
apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx (2)

43-83: Tests are well-structured and correctly cover the three key branches of handlePlaySound.

The mock isolation via beforeEach (mockPlay.mockClear() + resetting mockUseRoomSubscription.mockReturnValue) is correct. The positive + negative assertion pattern (e.g., toHaveBeenCalledWith('chime') + not.toHaveBeenCalledWith('default')) in tests 1 and 3 is particularly clean. Test 3 correctly overrides the room subscription within the test body before rendering, so beforeEach still cleanly restores the default for tests 1 and 2.


27-30: No changes needed for type safety.

The .withUserPreference() method is typed to accept value: unknown, so passing userPreferences?.newMessageNotification ?? 'chime' (which has type unknown) is fully compatible. The current code has no type errors and is correct as written.

			> Likely an incorrect or invalid review comment.

Walkthrough

Fixes notification sound playback: when desktop sound is "default", the code resolves to the user's newMessageNotification preference (fallback chime) before playing. Adds tests for playback resolution and an aria-label on the play button.

Changes

Notification Preferences — playback resolution, UI, tests, changeset

Layer / File(s) Summary
Changeset
.changeset/major-coats-smash.md
Adds a changeset entry to publish a patch for @rocket.chat/meteor describing the notification preferences test-button fix.
Data / Preference read
apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.tsx
Imports and uses useUserPreference to obtain newMessageNotification (with 'chime' fallback) for resolving 'default' desktop sound.
Core playback logic
apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.tsx
handlePlaySound now treats undefined/'default' desktop sound as the user preference and passes the resolved sound to customSound.play instead of 'default'.
UI attribute
apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesForm.tsx
Play IconButton for desktop sound gains aria-label={t('Play')} (icon, margin, and onClick remain).
Tests
apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx
New test suite mocking useCustomSound and room subscription; verifies: default desktop sound resolves to user preference, user preference playback chosen, and explicit desktop sound takes precedence. Mocks cleared in beforeEach.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI as NotificationPreferences UI
    participant Pref as useUserPreference
    participant Sub as useRoomSubscription
    participant Sound as useCustomSound

    User->>UI: Click play button
    UI->>Sub: read audioNotificationValue (desktopSound)
    alt desktopSound is "default" or undefined
        UI->>Pref: read newMessageNotification (fallback "chime")
        Pref-->>UI: userSound
        UI->>Sound: play(userSound)
    else desktopSound is explicit
        Sub-->>UI: desktopSound
        UI->>Sound: play(desktopSound)
    end
    Sound-->>UI: playback started
    UI-->>User: feedback (playing)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 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 accurately describes the main fix: resolving the test button failing to play the default sound in notification preferences, which matches the core functionality change across the modified files.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • SUP-1027: Request failed with status code 401

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.07%. Comparing base (3d3970a) to head (e7bc5a1).
⚠️ Report is 30 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #40335      +/-   ##
===========================================
+ Coverage    69.94%   70.07%   +0.13%     
===========================================
  Files         3297     3301       +4     
  Lines       119267   120778    +1511     
  Branches     21515    21619     +104     
===========================================
+ Hits         83416    84638    +1222     
- Misses       32548    32846     +298     
+ Partials      3303     3294       -9     
Flag Coverage Δ
e2e 59.63% <50.00%> (-0.20%) ⬇️
e2e-api 46.24% <ø> (-0.84%) ⬇️
unit 70.95% <100.00%> (+0.26%) ⬆️

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.

@nazabucciarelli nazabucciarelli requested a review from Copilot April 30, 2026 02:32
@nazabucciarelli nazabucciarelli changed the title fix test button not playing default sound fix: test button not playing default sound in notification preferences Apr 30, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the Notifications Preferences “test” action so that choosing "default" plays the user’s configured newMessageNotification sound (instead of failing to resolve a sound source).

Changes:

  • Resolve "default" to the user’s newMessageNotification preference before looking up the sound in CustomSoundProvider.
  • Add unit tests validating "default" resolution behavior and direct sound playback.
  • Add a changeset documenting the bugfix.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
apps/meteor/client/providers/CustomSoundProvider/CustomSoundProvider.tsx Map "default" to the preferred notification sound when playing.
apps/meteor/client/providers/CustomSoundProvider/CustomSoundProvider.spec.tsx Adds tests for "default" resolution and normal sound playback.
.changeset/major-coats-smash.md Adds release note entry for the fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/meteor/client/providers/CustomSoundProvider/CustomSoundProvider.tsx Outdated
Comment thread apps/meteor/client/providers/CustomSoundProvider/CustomSoundProvider.spec.tsx Outdated
@nazabucciarelli nazabucciarelli added this to the 8.5.0 milestone Apr 30, 2026
@nazabucciarelli nazabucciarelli marked this pull request as ready for review April 30, 2026 14:59
@nazabucciarelli nazabucciarelli requested a review from a team as a code owner April 30, 2026 15:00
cardoso
cardoso previously approved these changes Apr 30, 2026
Comment thread apps/meteor/client/providers/CustomSoundProvider/CustomSoundProvider.tsx Outdated
Copy link
Copy Markdown
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.

🧹 Nitpick comments (2)
apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx (2)

18-22: 💤 Low value

Remove the inline comments from the test setup.

They add noise and violate the repo rule for TypeScript/JavaScript files to avoid code comments in implementation. As per coding guidelines, **/*.{ts,tsx,js}: Avoid code comments in the implementation.

Proposed cleanup
 jest.mock('../../contexts/RoomContext', () => ({
 	useRoom: () => ({ _id: 'GENERAL' }),
-	// 2. Conectamos la exportación al mock dinámico
 	useRoomSubscription: () => mockUseRoomSubscription(),
 }));
@@
 	mockUseRoomSubscription.mockReturnValue({
 		disableNotifications: false,
 		muteGroupMentions: false,
 		hideUnreadStatus: false,
 		hideMentionStatus: false,
-		audioNotificationValue: undefined, // desktopSound defaults to 'default'
+		audioNotificationValue: undefined,
 	});
 });

Also applies to: 32-40

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx`
around lines 18 - 22, Remove the inline comments in the test mock setup: in the
jest.mock block replace the commented lines with just the exports—return
useRoom: () => ({ _id: 'GENERAL' }) and useRoomSubscription: () =>
mockUseRoomSubscription()—and similarly remove any other inline comments around
useRoom, useRoomSubscription, and mockUseRoomSubscription in this spec (also
apply the same cleanup for the occurrences around lines 32-40).

27-30: ⚡ Quick win

Add one case that leaves newMessageNotification unset.

appRoot() always defaults the preference to "chime", so this suite never exercises the real fallback path when the user preference is missing. A regression there would still pass these tests.

Suggested test update
-const appRoot = (userPreferences?: Record<string, unknown>) =>
-	mockAppRoot()
-		.withUserPreference('newMessageNotification', userPreferences?.newMessageNotification ?? 'chime')
-		.build();
+const appRoot = (userPreferences?: Record<string, unknown>) => {
+	const root = mockAppRoot();
+	if (userPreferences?.newMessageNotification !== undefined) {
+		root.withUserPreference('newMessageNotification', userPreferences.newMessageNotification);
+	}
+	return root.build();
+};
@@
 	it('plays the user newMessageNotification preference when desktopSound is "default"', async () => {
 		render(<NotificationPreferencesWithData />, {
 			wrapper: appRoot({ newMessageNotification: 'chime' }),
 		});
@@
 		expect(mockPlay).toHaveBeenCalledWith('chime');
 	});
+
+	it('falls back to chime when newMessageNotification is unset', async () => {
+		render(<NotificationPreferencesWithData />, {
+			wrapper: appRoot(),
+		});
+
+		await userEvent.click(screen.getByTestId('play-sound-button'));
+
+		expect(mockPlay).toHaveBeenCalledWith('chime');
+	});

Also applies to: 43-53

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx`
around lines 27 - 30, The test helper appRoot is always forcing
newMessageNotification to 'chime' which prevents testing the unset/fallback
path; change appRoot in NotificationPreferencesWithData.spec.tsx so it only
calls .withUserPreference('newMessageNotification', ...) when userPreferences
has an own value for newMessageNotification (i.e., check for property existence
instead of using ?? 'chime'), then add a test case that calls appRoot() or
appRoot({}) to render the component with newMessageNotification truly unset and
assert the fallback behavior; update both places referenced (the helper at top
and the additional tests around lines 43-53) to cover the missing-preference
path.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx`:
- Around line 18-22: Remove the inline comments in the test mock setup: in the
jest.mock block replace the commented lines with just the exports—return
useRoom: () => ({ _id: 'GENERAL' }) and useRoomSubscription: () =>
mockUseRoomSubscription()—and similarly remove any other inline comments around
useRoom, useRoomSubscription, and mockUseRoomSubscription in this spec (also
apply the same cleanup for the occurrences around lines 32-40).
- Around line 27-30: The test helper appRoot is always forcing
newMessageNotification to 'chime' which prevents testing the unset/fallback
path; change appRoot in NotificationPreferencesWithData.spec.tsx so it only
calls .withUserPreference('newMessageNotification', ...) when userPreferences
has an own value for newMessageNotification (i.e., check for property existence
instead of using ?? 'chime'), then add a test case that calls appRoot() or
appRoot({}) to render the component with newMessageNotification truly unset and
assert the fallback behavior; update both places referenced (the helper at top
and the additional tests around lines 43-53) to cover the missing-preference
path.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d214818e-c322-4b56-8e3e-90fb876d3425

📥 Commits

Reviewing files that changed from the base of the PR and between 4a6ece2 and c807544.

📒 Files selected for processing (2)
  • apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesForm.tsx
  • apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx
✅ Files skipped from review due to trivial changes (1)
  • apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesForm.tsx
📜 Review details
⏰ 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: cubic · AI code reviewer
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{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/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx
🧠 Learnings (13)
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Utilize Playwright fixtures (`test`, `page`, `expect`) for consistency in test files

Applied to files:

  • apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx
📚 Learning: 2026-04-17T18:33:27.211Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 39858
File: apps/meteor/tests/e2e/apps/uikit-interactions.spec.ts:123-151
Timestamp: 2026-04-17T18:33:27.211Z
Learning: In RocketChat/Rocket.Chat (`apps/meteor/tests/e2e/apps/uikit-interactions.spec.ts`), `executeBlockActionHandler` invocations originating from a **modal** surface intentionally do NOT include a `block_action_room` (room property) in the interaction payload. Modals are not scoped to a room, so no room id is available in that context. Do not flag the absence of a room assertion in the modal block-action test as a missing coverage bug; instead, document it explicitly with a `test.step` asserting the room entry is `undefined`.

Applied to files:

  • apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Prefer web-first assertions (`toBeVisible`, `toHaveText`, etc.) in Playwright tests

Applied to files:

  • apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Maintain test isolation between test cases in Playwright tests

Applied to files:

  • apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx
📚 Learning: 2025-12-10T21:00:54.909Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37091
File: ee/packages/abac/jest.config.ts:4-7
Timestamp: 2025-12-10T21:00:54.909Z
Learning: Rocket.Chat monorepo: Jest testMatch pattern '<rootDir>/src/**/*.spec.(ts|js|mjs)' is valid in this repo and used across multiple packages (e.g., packages/tools, ee/packages/omnichannel-services). Do not flag it as invalid in future reviews.

Applied to files:

  • apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `expect` matchers for assertions (`toEqual`, `toContain`, `toBeTruthy`, `toHaveLength`, etc.) instead of `assert` statements in Playwright tests

Applied to files:

  • apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to **/*.spec.ts : Use descriptive test names that clearly communicate expected behavior in Playwright tests

Applied to files:

  • apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure tests run reliably in parallel without shared state conflicts

Applied to files:

  • apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : All test files must be created in `apps/meteor/tests/e2e/` directory

Applied to files:

  • apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `test.beforeAll()` and `test.afterAll()` for setup/teardown in Playwright tests

Applied to files:

  • apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx
📚 Learning: 2026-02-24T19:22:52.984Z
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:52.984Z
Learning: In RocketChat/Rocket.Chat Playwright e2e tests, prefer using translated text and ARIA roles (getByRole, getByText, etc.) over data-qa locators. If translation values change, update the corresponding test locators accordingly. Never prefer data-qa locators.

Applied to files:

  • apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx
📚 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/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx
📚 Learning: 2026-03-27T14:52:56.865Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39892
File: apps/meteor/client/views/room/contextualBar/Threads/Thread.tsx:150-155
Timestamp: 2026-03-27T14:52:56.865Z
Learning: In Rocket.Chat, there are two different `ModalBackdrop` components with different prop APIs. During review, confirm the import source: (1) `rocket.chat/fuselage` `ModalBackdrop` uses `ModalBackdropProps` based on `BoxProps` (so it supports `onClick` and other Box/DOM props) and does not have an `onDismiss` prop; (2) `rocket.chat/ui-client` `ModalBackdrop` uses a narrower props interface like `{ children?: ReactNode; onDismiss?: () => void }` and handles Escape keypress and outside mouse-up, and it does not forward arbitrary DOM props such as `onClick`. Flag mismatched props (e.g., `onDismiss` passed to the fuselage component or `onClick` passed to the ui-client component) and ensure the usage matches the correct component being imported.

Applied to files:

  • apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx
🔇 Additional comments (1)
apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesWithData.spec.tsx (1)

43-82: Looks good overall.

The three playback paths are covered, the mocks are isolated per test, and the assertions match the intended sound-resolution behavior.

Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

No issues found across 4 files

@nazabucciarelli nazabucciarelli force-pushed the fix/sound-reproduction-for-default branch from c807544 to dd9f430 Compare May 1, 2026 00:26
@nazabucciarelli nazabucciarelli added the stat: QA assured Means it has been tested and approved by a company insider label May 4, 2026
@nazabucciarelli nazabucciarelli removed the stat: QA assured Means it has been tested and approved by a company insider label May 4, 2026
@dionisio-bot dionisio-bot Bot removed the stat: ready to merge PR tested and approved waiting for merge label May 4, 2026
@nazabucciarelli nazabucciarelli added stat: ready to merge PR tested and approved waiting for merge stat: QA assured Means it has been tested and approved by a company insider labels May 4, 2026
@dionisio-bot dionisio-bot Bot added this pull request to the merge queue May 4, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 4, 2026
@nazabucciarelli nazabucciarelli removed the stat: QA assured Means it has been tested and approved by a company insider label May 4, 2026
@dionisio-bot dionisio-bot Bot removed the stat: ready to merge PR tested and approved waiting for merge label May 4, 2026
@nazabucciarelli nazabucciarelli added the stat: QA assured Means it has been tested and approved by a company insider label May 4, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label May 4, 2026
@dionisio-bot dionisio-bot Bot added this pull request to the merge queue May 4, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 4, 2026
@nazabucciarelli nazabucciarelli removed the stat: QA assured Means it has been tested and approved by a company insider label May 4, 2026
@dionisio-bot dionisio-bot Bot removed the stat: ready to merge PR tested and approved waiting for merge label May 4, 2026
@nazabucciarelli nazabucciarelli added stat: ready to merge PR tested and approved waiting for merge stat: QA assured Means it has been tested and approved by a company insider labels May 4, 2026
@dionisio-bot dionisio-bot Bot added this pull request to the merge queue May 4, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 4, 2026
@nazabucciarelli nazabucciarelli modified the milestone: 8.5.0 May 4, 2026
@dionisio-bot dionisio-bot Bot added stat: ready to merge PR tested and approved waiting for merge and removed stat: ready to merge PR tested and approved waiting for merge labels May 4, 2026
@dionisio-bot dionisio-bot Bot added this pull request to the merge queue May 4, 2026
@nazabucciarelli nazabucciarelli added stat: ready to merge PR tested and approved waiting for merge and removed stat: ready to merge PR tested and approved waiting for merge labels May 4, 2026
Merged via the queue into develop with commit 378e214 May 4, 2026
82 of 84 checks passed
@dionisio-bot dionisio-bot Bot deleted the fix/sound-reproduction-for-default branch May 4, 2026 23:31
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 type: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants