Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test] Update test-utils and remove enzyme #473

Merged
merged 5 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"@babel/plugin-transform-react-constant-elements": "^7.24.6",
"@babel/preset-typescript": "^7.24.6",
"@mui/internal-docs-utils": "^1.0.7",
"@mui/internal-test-utils": "1.0.0-dev.20240529-082515-213b5e33ab",
"@mui/internal-test-utils": "1.0.3",
"@types/autosuggest-highlight": "^3.2.3",
"@types/chai": "^4.3.16",
"@types/node": "^18.19.33",
Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,16 @@
"@babel/preset-react": "^7.24.6",
"@babel/preset-typescript": "^7.24.6",
"@babel/register": "^7.24.6",
"@mnajdova/enzyme-adapter-react-18": "^0.2.0",
"@mui/internal-docs-utils": "^1.0.7",
"@mui/internal-markdown": "^1.0.6",
"@mui/internal-scripts": "^1.0.11",
"@mui/internal-test-utils": "1.0.0-dev.20240529-082515-213b5e33ab",
"@mui/internal-test-utils": "1.0.3",
"@mui/material": "6.0.0-alpha.13",
"@mui/monorepo": "github:mui/material-ui#v6.0.0-alpha.12",
"@mui/utils": "6.0.0-alpha.13",
"@next/eslint-plugin-next": "^14.2.3",
"@octokit/rest": "^20.1.1",
"@playwright/test": "1.44.1",
"@types/enzyme": "^3.10.18",
"@types/fs-extra": "^11.0.4",
"@types/lodash": "^4.17.4",
"@types/mocha": "^10.0.6",
Expand All @@ -110,7 +108,6 @@
"cross-env": "^7.0.3",
"danger": "^12.1.0",
"docs": "workspace:^",
"enzyme": "^3.11.0",
"eslint": "^8.57.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-base": "^15.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
},
"devDependencies": {
"@mui/internal-babel-macros": "^1.0.1",
"@mui/internal-test-utils": "1.0.0-dev.20240529-082515-213b5e33ab",
"@mui/internal-test-utils": "1.0.3",
"@testing-library/react": "^15.0.7",
"@testing-library/user-event": "^14.5.2",
"@types/chai": "^4.3.16",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ describe('<AlertDialog.Backdrop />', () => {
</AlertDialog.Root>,
);
},
skip: ['reactTestRenderer'],
}));

it('has role="presentation"', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ describe('<AlertDialog.Close />', () => {
</AlertDialog.Root>,
);
},
skip: ['reactTestRenderer'],
}));
});
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ describe('<AlertDialog.Description />', () => {
</AlertDialog.Root>,
);
},
skip: ['reactTestRenderer'],
}));
});
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ describe('<AlertDialog.Popup />', () => {
</AlertDialog.Root>,
);
},
skip: ['reactTestRenderer'],
}));

it('should have role="alertdialog"', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ describe('<AlertDialog.Title />', () => {
</AlertDialog.Root>,
);
},
skip: ['reactTestRenderer'],
}));
});
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ describe('<AlertDialog.Trigger />', () => {
</AlertDialog.Root>,
);
},
skip: ['reactTestRenderer'],
}));
});
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ describe('<Checkbox.Indicator />', () => {
<CheckboxContext.Provider value={testContext}>{node}</CheckboxContext.Provider>,
);
},
skip: ['reactTestRenderer'],
}));

it('should not render indicator by default', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ describe('<Dialog.Backdrop />', () => {
</Dialog.Root>,
);
},
skip: ['reactTestRenderer'],
}));

it('has role="presentation"', () => {
Expand Down
1 change: 0 additions & 1 deletion packages/mui-base/src/Dialog/Close/DialogClose.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ describe('<Dialog.Close />', () => {
</Dialog.Root>,
);
},
skip: ['reactTestRenderer'],
}));
});
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ describe('<Dialog.Description />', () => {
</Dialog.Root>,
);
},
skip: ['reactTestRenderer'],
}));
});
1 change: 0 additions & 1 deletion packages/mui-base/src/Dialog/Popup/DialogPopup.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ describe('<Dialog.Popup />', () => {
</Dialog.Root>,
);
},
skip: ['reactTestRenderer'],
}));

describe('prop: keepMounted', () => {
Expand Down
4 changes: 3 additions & 1 deletion packages/mui-base/src/Dialog/Root/DialogRoot.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ describe('<Dialog.Root />', () => {
});
});

describe('prop: modal', () => {
// toWarnDev doesn't work reliably with async rendering. To re-eanble after it's fixed in the test-utils.
// eslint-disable-next-line mocha/no-skipped-tests
describe.skip('prop: modal', () => {
it('warns when the dialog is modal but no backdrop is present', async () => {
await expect(() =>
render(
Expand Down
1 change: 0 additions & 1 deletion packages/mui-base/src/Dialog/Title/DialogTitle.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ describe('<Dialog.Title />', () => {
</Dialog.Root>,
);
},
skip: ['reactTestRenderer'],
}));
});
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ describe('<Dialog.Trigger />', () => {
</Dialog.Root>,
);
},
skip: ['reactTestRenderer'],
}));
});
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ describe('<NumberField.Decrement />', () => {
<NumberFieldContext.Provider value={testContext}>{node}</NumberFieldContext.Provider>,
);
},
skip: ['reactTestRenderer'],
}));

it('has decrease label', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ describe('<NumberField.Group />', () => {
<NumberFieldContext.Provider value={testContext}>{node}</NumberFieldContext.Provider>,
);
},
skip: ['reactTestRenderer'],
}));

it('has role prop', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ describe('<NumberField.Increment />', () => {
<NumberFieldContext.Provider value={testContext}>{node}</NumberFieldContext.Provider>,
);
},
skip: ['reactTestRenderer'],
}));

it('has increase label', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ describe('<NumberField.Input />', () => {
<NumberFieldContext.Provider value={testContext}>{node}</NumberFieldContext.Provider>,
);
},
skip: ['reactTestRenderer'],
}));

it('has textbox role', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ describe('<NumberField.ScrubArea />', () => {
<NumberFieldContext.Provider value={testContext}>{node}</NumberFieldContext.Provider>,
);
},
skip: ['reactTestRenderer'],
}));

it('has presentation role', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ describe('<NumberField.ScrubAreaCursor />', () => {
<NumberFieldContext.Provider value={testContext}>{node}</NumberFieldContext.Provider>,
);
},
skip: ['reactTestRenderer'],
}));

it('has presentation role', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ describe('<Popover.Arrow />', () => {
</Popover.Root>,
);
},
skip: ['reactTestRenderer'],
}));
});
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ describe('<Popover.Backdrop />', () => {
</Popover.Root>,
);
},
skip: ['reactTestRenderer'],
}));
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ describe('<Popover.Close />', () => {
</Popover.Root>,
);
},
skip: ['reactTestRenderer'],
}));

it('should close popover when clicked', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ describe('<Popover.Description />', () => {
</Popover.Root>,
);
},
skip: ['reactTestRenderer'],
}));

it('describes the popup element with its id', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ describe('<Popover.Popup />', () => {
</Popover.Root>,
);
},
skip: ['reactTestRenderer'],
}));

it('should render the children', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ describe('<Popover.Positioner />', () => {
</Popover.Root>,
);
},
skip: ['reactTestRenderer'],
}));
});
Loading