Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
ec92d89
Upgrade LG modal packages
kraenhansen Dec 18, 2025
c0ef6fa
Fix Modal to adopt LG Modal v20
kraenhansen Sep 30, 2025
2a4a76d
Fix connection-form to work around LG Modal v20
kraenhansen Sep 30, 2025
f6de037
Update generative-ai to adopt marketing-modal v7
kraenhansen Sep 30, 2025
f3feb66
Fix compass-import-export to work around LG modal v20
kraenhansen Sep 30, 2025
d2f9411
Update compass-welcome to adopt marketing-modal v7
kraenhansen Nov 5, 2025
2d4fcf9
Update compass-explain-plan to LG Modal v20
kraenhansen Oct 1, 2025
bcdfb26
Fix compass-crud to adopt LG modal v20
kraenhansen Oct 1, 2025
dedb29e
Update compass-schema to LG Modal v20
kraenhansen Oct 1, 2025
23c9b9f
Add workaround for jsdom missing HTMLDialogElement support
kraenhansen Oct 2, 2025
e8e8770
Update generative-ai to adopt LG modal v20
kraenhansen Oct 7, 2025
22b6d10
Fix fullScreen prop on derived Modal
kraenhansen Oct 7, 2025
1bdc87e
Remove use of deprecated backdropClassName
kraenhansen Oct 7, 2025
1d45b5a
Remove workaround for MarketingModal button disabling
kraenhansen Dec 10, 2025
6e8624a
Fix remaining components tests
kraenhansen Oct 7, 2025
ba8e128
Revert workaround for LG-5593
kraenhansen Oct 8, 2025
b3e1d3f
Update existing tests to handle dialog elements remaining in the DOM
kraenhansen Nov 5, 2025
d1b75f0
Update databases-collections to allow immediate removal of the heading
kraenhansen Nov 6, 2025
9428ef0
Update e2e tests to use waitForDisplayed over waitForExist as this is…
kraenhansen Nov 6, 2025
47888eb
Update e2e tests removing [role=dialog] from confirm dialog selectors
kraenhansen Nov 7, 2025
a63d598
Update e2e tests to wait for bulk delete modal to disappear
kraenhansen Nov 7, 2025
1f2f4a4
Update e2e tests to wait for connection form to be non-clickable in a…
kraenhansen Nov 7, 2025
c2bed1f
Update e2e tests to fix modal regressions
kraenhansen Nov 21, 2025
059a651
Disable pointer events on a closed modal
kraenhansen Nov 10, 2025
fc8b6eb
Disable auto-focus on confirmation modal children by default
kraenhansen Nov 10, 2025
df5ba1c
Add new modal specific commands
kraenhansen Nov 11, 2025
8a5d987
Update E2E tests to use new modal commands instead of waitForDisplayed
kraenhansen Nov 11, 2025
f5d901a
Default initialFocus to "null" to avoid breaking existing modals
kraenhansen Nov 12, 2025
fbb4ff0
Wait for confirm button to show instead of simply expecting it
kraenhansen Nov 17, 2025
6946951
Update FocusMode tests to handle LG Modal v20
kraenhansen Nov 25, 2025
ce4de95
Update SettingsModal tests to handle LG Modal v20
kraenhansen Nov 25, 2025
a696d7e
Clarify disabling the @typescript-eslint/no-namespace and add a TODO …
kraenhansen Nov 26, 2025
fec839f
Partial revert of ddd6d70dd59fbe8f948ea6e5ef80b6d478bc1eff
kraenhansen Nov 26, 2025
4b26c6b
Fix auto-focus in bulk update and delete modals
kraenhansen Dec 1, 2025
ac00cfd
Correcting sizing styles
kraenhansen Dec 9, 2025
3c626c2
Correcting sizing styles more
kraenhansen Dec 9, 2025
d27b33d
Use named imports
kraenhansen Dec 18, 2025
f8f6cd6
Upgrade confirm-modal package
kraenhansen Dec 18, 2025
9d5c979
Fix useConfirmation's confirmButtonProps types
kraenhansen Dec 18, 2025
072f47c
Update use of ConfirmationModal
kraenhansen Dec 18, 2025
c95b12f
Set initial focus on cancel (fallback to confirm) button
kraenhansen Dec 18, 2025
536b433
Fix package lock
kraenhansen Dec 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,25 @@ Object.assign(tabbable, {
origTabbable.isTabbable(node, { ...options, displayCheck: 'none' }),
});

// Workaround for missing HTMLDialogElement in jsdom
// See https://github.com/jsdom/jsdom/issues/3294

Object.assign(HTMLDialogElement.prototype, {
show() {
this.open = true;
this.style.display = '';
},
showModal() {
this.open = true;
this.style.display = '';
},
close(returnValue) {
this.open = false;
this.returnValue = returnValue;
this.style.display = 'none';
},
});

// leafygreen (through `clipboard` library) uses deprecated API check that is
// not working in jsdom if copy / paste APIs are supported
if (!window.document.queryCommandSupported) {
Expand Down
43 changes: 43 additions & 0 deletions configs/testing-library-compass/src/assertions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { Assertion, util } from 'chai';

// TODO(COMPASS-10119): Move declaration into a separate .d.ts and implementation into a *-register.js file as we do with other global patching code intended for tests.

declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace -- We're following a pattern established in the `@types/chai-as-promised` package to add a Chai assertion property.
export namespace Chai {
interface Assertion {
/** Asserts that a dialog is open */
get open(): Assertion;
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Anemy FYI for the eslint plugin you are working on in devtools-shared, new terminator assertion

/** Asserts that a dialog is closed */
get closed(): Assertion;
}
}
}

util.addProperty(
Assertion.prototype,
'open',
function (this: typeof Assertion) {
const obj = util.flag(this, 'object');
new Assertion(obj).to.be.instanceof(HTMLDialogElement);
new Assertion(obj as HTMLDialogElement).has.property(
'open',
true,
'Expected dialog to be open'
);
}
);

util.addProperty(
Assertion.prototype,
'closed',
function (this: typeof Assertion) {
const obj = util.flag(this, 'object');
new Assertion(obj).to.be.instanceof(HTMLDialogElement);
new Assertion(obj as HTMLDialogElement).has.property(
'open',
false,
'Expected dialog to be closed'
);
}
);
2 changes: 2 additions & 0 deletions configs/testing-library-compass/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ import { expect } from 'chai';
import { Provider } from 'react-redux';
import ConnectionString from 'mongodb-connection-string-url';

import './assertions';

function wait(ms: number) {
return new Promise((resolve) => {
setTimeout(resolve, ms);
Expand Down
Loading
Loading