Files
2024-02-15 17:01:50 +00:00

26 lines
786 B
TypeScript

import {CodeOwnerFixture} from 'sentry-fixture/codeOwner';
import {render, screen} from 'sentry-test/reactTestingLibrary';
import ViewCodeOwnerModal from './viewCodeOwnerModal';
describe('ViewCodeOwnerModal', () => {
const mockComponent: any = ({children}) => <div>{children}</div>;
it('should display parsed codeowners file', () => {
const ownershipSyntax = `codeowners:/src/sentry/migrations/ #developer-infrastructure\n`;
render(
<ViewCodeOwnerModal
codeowner={CodeOwnerFixture({ownershipSyntax})}
closeModal={jest.fn()}
Header={mockComponent}
Footer={mockComponent}
Body={mockComponent}
CloseButton={mockComponent}
/>
);
expect(screen.getByRole('textbox')).toHaveValue(ownershipSyntax);
});
});