viewCodeOwnerModal.spec.tsx 729 B

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