mirror of
https://github.com/wassname/talk.git
synced 2026-07-20 12:40:47 +08:00
Adding signing flow to tests.
This commit is contained in:
@@ -56,7 +56,7 @@ const SignInContent = ({handleChange, formData, ...props}) => (
|
||||
<span><a onClick={() => props.changeView('FORGOT')}>{lang.t('signIn.forgotYourPass')}</a></span>
|
||||
<span>
|
||||
{lang.t('signIn.needAnAccount')}
|
||||
<a onClick={() => props.changeView('SIGNUP')}>
|
||||
<a onClick={() => props.changeView('SIGNUP')} id='coralRegister'>
|
||||
{lang.t('signIn.register')}
|
||||
</a>
|
||||
</span>
|
||||
|
||||
@@ -69,7 +69,7 @@ const SignUpContent = ({handleChange, formData, ...props}) => (
|
||||
/>
|
||||
<div className={styles.action}>
|
||||
{ !props.auth.isLoading && !props.auth.successSignUp && (
|
||||
<Button type="submit" cStyle="black" className={styles.signInButton}>
|
||||
<Button type="submit" cStyle="black" id='coralSignUpButton' className={styles.signInButton}>
|
||||
{lang.t('signIn.signUp')}
|
||||
</Button>
|
||||
)}
|
||||
|
||||
@@ -127,7 +127,7 @@ class SignInContainer extends Component {
|
||||
const {auth, showSignInDialog} = this.props;
|
||||
return (
|
||||
<div>
|
||||
<Button onClick={showSignInDialog}>
|
||||
<Button onClick={showSignInDialog} id='coralSignInButton'>
|
||||
Sign in to comment
|
||||
</Button>
|
||||
<SignDialog
|
||||
|
||||
@@ -2,7 +2,11 @@ const utils = require('../../utils/e2e-mongoose');
|
||||
const Setting = require('../../../models/setting');
|
||||
const fetch = require('node-fetch');
|
||||
|
||||
const comment = 'This is a test comment.';
|
||||
const mockComment = 'This is a test comment.';
|
||||
const mockUser = {
|
||||
email: 'test@test.com',
|
||||
pw: 'testtesttest'
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
'@tags': ['embed-stream', 'post'],
|
||||
@@ -18,15 +22,24 @@ module.exports = {
|
||||
})
|
||||
});
|
||||
},
|
||||
'User posts a comment': client => {
|
||||
'User signs in and posts a comment': client => {
|
||||
client.resizeWindow(1200, 800)
|
||||
.url(client.globals.baseUrl)
|
||||
.frame('coralStreamIframe')
|
||||
.waitForElementVisible('#commentBox', 2000)
|
||||
.setValue('#commentBox .coral-plugin-commentbox-textarea', comment)
|
||||
.waitForElementVisible('#coralSignInButton', 2000)
|
||||
.click('#coralSignInButton')
|
||||
.waitForElementVisible('#coralRegister', 1000)
|
||||
.click('#coralRegister')
|
||||
.waitForElementVisible('#email', 1000)
|
||||
.setValue('#email', mockUser.email)
|
||||
.setValue('#password', mockUser.pw)
|
||||
.setValue('#confirmPassword', mockUser.pw)
|
||||
.click('#coralSignUpButton')
|
||||
.waitForElementVisible('#commentBox', 1000)
|
||||
.setValue('#commentBox .coral-plugin-commentbox-textarea', mockComment)
|
||||
.click('#commentBox .coral-plugin-commentbox-button')
|
||||
.waitForElementVisible('.comment', 1000)
|
||||
.assert.containsText('.comment', comment);
|
||||
.assert.containsText('.comment', mockComment);
|
||||
},
|
||||
after: client => {
|
||||
utils.after();
|
||||
|
||||
Reference in New Issue
Block a user