From 285b272bf4e7c11e7a3cd169c2d6a80764d1e7a1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Feb 2026 17:58:35 +0000 Subject: [PATCH 1/2] Initial plan From 5377f319d2d79b9f749878e18df507e6feef1173 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Feb 2026 18:07:46 +0000 Subject: [PATCH 2/2] Fix broken unit tests and add coverage for IncomingTask notification deletion Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com> --- .../___tests__/maskIdentifiers/index.test.ts | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/plugin-hrm-form/src/___tests__/maskIdentifiers/index.test.ts b/plugin-hrm-form/src/___tests__/maskIdentifiers/index.test.ts index 2044270c95..bec37dcf3c 100644 --- a/plugin-hrm-form/src/___tests__/maskIdentifiers/index.test.ts +++ b/plugin-hrm-form/src/___tests__/maskIdentifiers/index.test.ts @@ -16,7 +16,7 @@ /* eslint-disable camelcase */ -import { Manager } from '@twilio/flex-ui'; +import { Manager, Notifications } from '@twilio/flex-ui'; import each from 'jest-each'; import { maskConversationServiceUserNames, maskChannelStringsWithIdentifiers } from '../../maskIdentifiers'; @@ -36,8 +36,12 @@ jest.mock('@twilio/flex-ui', () => ({ Manager: { getInstance: jest.fn(), }, + Notifications: { + registeredNotifications: new Map(), + }, NotificationIds: { NewChatMessage: 'NewChatMessage', + IncomingTask: 'IncomingTask', }, DefaultTaskChannels: { ChatSms: { name: 'ChatSms' }, @@ -47,6 +51,8 @@ jest.mock('@twilio/flex-ui', () => ({ }, })); +const mockRegisteredNotifications = Notifications.registeredNotifications as Map; + const mockLookupTranslation = lookupTranslation as jest.MockedFunction; const mockGetInitializedCan = getInitializedCan as jest.MockedFunction; @@ -441,6 +447,8 @@ describe('maskChannelStringsWithIdentifiers', () => { mockGetInitializedCan.mockReturnValue(mockCan); mockManagerGetInstance.mockReturnValue({ strings: { MaskIdentifiers: 'MASKED' } } as any); mockLookupTranslation.mockReturnValue('Masked Title'); + mockRegisteredNotifications.clear(); + mockRegisteredNotifications.set('IncomingTask', {}); }); afterEach(() => { @@ -468,6 +476,12 @@ describe('maskChannelStringsWithIdentifiers', () => { expect(mockLookupTranslation).toHaveBeenCalledWith('BrowserNotification-ChatMessage-MaskedTitle'); expect(notification.options.browser.title).toBe('Masked Title'); }); + + test('deletes IncomingTask notification', () => { + const channelType = createChannelType(); + maskChannelStringsWithIdentifiers(channelType as any); + expect(mockRegisteredNotifications.has('IncomingTask')).toBe(false); + }); }); describe('when VIEW_IDENTIFIERS permission is granted', () => { @@ -480,5 +494,11 @@ describe('maskChannelStringsWithIdentifiers', () => { maskChannelStringsWithIdentifiers(channelType as any); expect(channelType.notifications.override.NewChatMessage).toBeUndefined(); }); + + test('does not delete IncomingTask notification', () => { + const channelType = createChannelType(); + maskChannelStringsWithIdentifiers(channelType as any); + expect(mockRegisteredNotifications.has('IncomingTask')).toBe(true); + }); }); });