Skip to content

Commit 6421b6b

Browse files
committed
ntp: send additional widget in context menu
1 parent 7ba712a commit 6421b6b

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

special-pages/pages/new-tab/app/mock-transport.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { tabsMockTransport } from './tabs/tabs.mock-transport.js';
2525
* @typedef {import('@duckduckgo/messaging/lib/test-utils.mjs').SubscriptionEvent} SubscriptionEvent
2626
*/
2727

28-
const VERSION_PREFIX = '__ntp_31__.';
28+
const VERSION_PREFIX = '__ntp_32__.';
2929
const url = new URL(window.location.href);
3030

3131
export function mockTransport() {

special-pages/pages/new-tab/app/omnibar/components/OmnibarConsumer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function AiSetting({ enableAi, setEnableAi }) {
6464
const { id, index } = useVisibility();
6565
useCustomizer({
6666
title: t('omnibar_toggleDuckAi'),
67-
id: `_${id}-toggleAi`,
67+
id: `${id}-toggleAi`,
6868
icon: <ArrowIndentCenteredIcon style={{ color: 'var(--ntp-icons-tertiary)' }} />,
6969
toggle: () => setEnableAi(!enableAi),
7070
visibility: enableAi ? 'visible' : 'hidden',

special-pages/pages/new-tab/app/omnibar/integration-tests/omnibar.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -993,10 +993,11 @@ test.describe('omnibar widget', () => {
993993
// Right-click on the page to trigger context menu
994994
await page.click('body', { button: 'right' });
995995

996-
// Assert that contextMenu notification is sent with real widgets and not e.g. the Duck.ai toggle
996+
// Assert that contextMenu notification is sent with an additional widget.
997997
await omnibar.expectMethodCalledWith('contextMenu', {
998998
visibilityMenuItems: [
999999
{ id: 'omnibar', title: 'Search' },
1000+
{ id: 'omnibar-toggleAi', title: 'Duck.ai' },
10001001
{ id: 'favorites', title: 'Favorites' },
10011002
{ id: 'protections', title: 'Protections Report' },
10021003
],

0 commit comments

Comments
 (0)