import cs from 'classnames' import _ from 'lodash' import { observer } from 'mobx-react' import React, { Component, MouseEvent } from 'react' // @ts-ignore import Tooltip from '@cypress/react-tooltip' import { indent } from '../lib/util' import appState, { AppState } from '../lib/app-state' import events, { Events } from '../lib/events' import Test from '../test/test' import Collapsible from '../collapsible/collapsible' import SuiteModel from './suite-model' import TestModel from '../test/test-model' interface SuiteProps { eventManager?: Events model: SuiteModel } const Suite = observer(({ eventManager = events, model }: SuiteProps) => { const _launchStudio = (e: MouseEvent) => { e.preventDefault() e.stopPropagation() eventManager.emit('studio:init:suite', model.id) } const _header = () => ( <> {model.title} ) return ( ) }) export interface RunnableProps { model: TestModel | SuiteModel appState: AppState } // NOTE: some of the driver tests dig into the React instance for this component // in order to mess with its internal state. converting it to a functional // component breaks that, so it needs to stay a Class-based component or // else the driver tests need to be refactored to support it being functional @observer class Runnable extends Component { static defaultProps = { appState, } render () { const { appState, model } = this.props return (
  • {model.type === 'test' ? : }
  • ) } } export { Suite } export default Runnable