viewCodeOwnerModal.spec.tsx 786 B

12345678910111213141516171819202122232425
  1. import {CodeOwnerFixture} from 'sentry-fixture/codeOwner';
  2. import {render, screen} from 'sentry-test/reactTestingLibrary';
  3. import ViewCodeOwnerModal from './viewCodeOwnerModal';
  4. describe('ViewCodeOwnerModal', () => {
  5. const mockComponent: any = ({children}) => <div>{children}</div>;
  6. it('should display parsed codeowners file', () => {
  7. const ownershipSyntax = `codeowners:/src/sentry/migrations/ #developer-infrastructure\n`;
  8. render(
  9. <ViewCodeOwnerModal
  10. codeowner={CodeOwnerFixture({ownershipSyntax})}
  11. closeModal={jest.fn()}
  12. Header={mockComponent}
  13. Footer={mockComponent}
  14. Body={mockComponent}
  15. CloseButton={mockComponent}
  16. />
  17. );
  18. expect(screen.getByRole('textbox')).toHaveValue(ownershipSyntax);
  19. });
  20. });