Skip to content

Commit 06d8ba2

Browse files
committed
Merge branch 'main' into fix-api-contract-and-anticipate-change
2 parents be29465 + 9c656bb commit 06d8ba2

File tree

74 files changed

+2427
-1543
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2427
-1543
lines changed

THIRD-PARTY-NOTICES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
The following third-party software is used by and included in **Mongodb Compass**.
2-
This document was automatically generated on Tue Sep 16 2025.
2+
This document was automatically generated on Wed Sep 17 2025.
33

44
## List of dependencies
55

configs/testing-library-compass/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"email": "[email protected]"
1212
},
1313
"homepage": "https://github.com/mongodb-js/compass",
14-
"version": "1.3.13",
14+
"version": "1.3.14",
1515
"repository": {
1616
"type": "git",
1717
"url": "https://github.com/mongodb-js/compass.git"

configs/testing-library-compass/src/index.tsx

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,29 @@ function createWrapper(
400400
return { wrapperState, wrapper };
401401
}
402402

403-
export type RenderConnectionsOptions = RenderOptions & TestConnectionsOptions;
403+
/**
404+
* Returns a new {@link RenderResult} with the {@link RenderResult.container} replaced by the container inserted by the context menu provider.
405+
*/
406+
function unwrapContextMenuContainer(result: RenderResult) {
407+
const { container, ...rest } = result;
408+
const { firstChild } = container;
409+
if (
410+
firstChild instanceof HTMLElement &&
411+
firstChild.getAttribute('data-testid') === 'context-menu-children-container'
412+
) {
413+
return { container: firstChild, ...rest };
414+
} else {
415+
return { container, ...rest };
416+
}
417+
}
418+
419+
export type RenderConnectionsOptions = RenderOptions &
420+
TestConnectionsOptions & {
421+
/**
422+
* Whether to include the context menu container and menu in the container of the returned result.
423+
*/
424+
includeContextMenu?: boolean;
425+
};
404426

405427
export type RenderWithConnectionsResult = ReturnType<
406428
typeof createWrapper
@@ -415,6 +437,7 @@ function renderWithConnections(
415437
baseElement,
416438
queries,
417439
hydrate,
440+
includeContextMenu = false,
418441
...connectionsOptions
419442
}: RenderConnectionsOptions = {}
420443
): RenderWithConnectionsResult {
@@ -443,7 +466,10 @@ function renderWithConnections(
443466
true,
444467
'Expected initial connections to load before rendering rest of the tested UI, but it did not happen'
445468
);
446-
return { ...wrapperState, ...result };
469+
return {
470+
...wrapperState,
471+
...(includeContextMenu ? result : unwrapContextMenuContainer(result)),
472+
};
447473
}
448474

449475
export type RenderHookConnectionsOptions<HookProps> = Omit<

docs/tracking-plan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
> the tracking plan for the specific Compass version you can use the following
77
> URL: `https://github.com/mongodb-js/compass/blob/<compass version>/docs/tracking-plan.md`
88
9-
Generated on Tue, Sep 16, 2025
9+
Generated on Wed, Sep 17, 2025
1010

1111
## Table of Contents
1212

0 commit comments

Comments
 (0)