Files
react-test/packages/mui-material/test/integration/DialogIntegration.test.js
how2ice 005cf56baf
Some checks failed
No response / noResponse (push) Has been cancelled
CI / Continuous releases (push) Has been cancelled
CI / test-dev (macos-latest) (push) Has been cancelled
CI / test-dev (ubuntu-latest) (push) Has been cancelled
CI / test-dev (windows-latest) (push) Has been cancelled
Maintenance / main (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
init project
2025-12-12 14:26:25 +09:00

32 lines
961 B
JavaScript

import * as React from 'react';
import { expect } from 'chai';
import { createRenderer, screen } from '@mui/internal-test-utils';
import Dialog from '@mui/material/Dialog';
import DialogTitle from '@mui/material/DialogTitle';
describe('<Dialog /> integration', () => {
const { render } = createRenderer();
it('is automatically labelled by its DialogTitle', () => {
render(
<Dialog open>
<DialogTitle>Set backup account</DialogTitle>
</Dialog>,
);
expect(screen.getByRole('dialog')).toHaveAccessibleName('Set backup account');
});
it('can be manually labelled', () => {
render(
<Dialog open aria-labelledby="dialog-title">
<DialogTitle id="dialog-title">Set backup account</DialogTitle>
</Dialog>,
);
const dialog = screen.getByRole('dialog');
expect(dialog).toHaveAccessibleName('Set backup account');
expect(dialog).to.have.attr('aria-labelledby', 'dialog-title');
});
});