我有一个Redux商店,想要连接它。这是我的容器组件的摘录:
interface IProps {
states: IAppState;
actions: IAppProps;
}
// mapping state to the props
const mapStateToProps = ( state: IAppState, ownProps = {} ) => ({
states: state
});
// mapping actions to the props
const mapDispatchToProps = ( dispatch: Redux.Dispatch<IAppState> ) => ({
actions: Redux.bindActionCreators( actions, dispatch )
});
// connect store to App
@connect<IAppState, IAppProps, any>(
mapStateToProps,
mapDispatchToProps
)
export default class App extends React.Component<IProps, {}> {
//...
}
Run Code Online (Sandbox Code Playgroud)
编译时收到以下问题:
error TS2345: Argument of type '(state: IAppState, …
Run Code Online (Sandbox Code Playgroud) 我的意思是功能测试或端到端测试。对于通用流程来说,这一切都很清楚,但当涉及到交易电子邮件(注册确认、密码重置、购买通知等)时,它仍然会带来问题。经过一番研究后,我提出了一些想法。一种是利用 Restmail.net API(此处以 Selenium WebDriver 和 Cypress 为例 - http://dsheiko.com/weblog/testing-sign-up-flow-with-activation-by-email)。它是免费的,但 API 是公开的。因此,它不太适合包含潜在敏感信息的电子邮件。通过 IMAP 桥或 Gmail API 访问 Gmail 收件箱的另一种方法(此处是说明和代码片段 - https://docs.puppetry.app/testing-emails/example-with-imap-bridge)。但同样,这只是一种解决方法。
我知道有像 Sendgrid、Mailgun、Email Yak、Postmark 这样的公司。我不想付那么多钱。那么大家是怎么做到的呢?这对你来说很重要吗?
testing automated-tests selenium-webdriver e2e-testing cypress