Fix register work visual test

This commit is contained in:
Brett Sun 2016-02-05 14:21:31 +01:00
parent 325651b581
commit 01b258334a
2 changed files with 14 additions and 7 deletions

View File

@ -294,18 +294,18 @@ const Property = React.createClass({
},
getCheckbox() {
const { checkboxLabel } = this.props;
const { checkboxLabel, name } = this.props;
if(checkboxLabel) {
if (checkboxLabel) {
return (
<div
className="ascribe-property-collapsible-toggle"
onClick={this.handleCheckboxToggle}>
<input
onChange={this.handleCheckboxToggle}
type="checkbox"
name={`${name}-checkbox`}
checked={this.state.expanded}
ref="checkboxCollapsible"/>
onChange={this.handleCheckboxToggle}
type="checkbox" />
<span className="checkbox">{' ' + checkboxLabel}</span>
</div>
);

View File

@ -166,9 +166,15 @@ gemini.suite('Authenticated', (suite) => {
gemini.suite('Register work', (registerSuite) => {
registerSuite
.setUrl('/register_piece')
.before((actions, find) => {
// The editions options are only rendered after the whitelabel is fetched, so
// we have to wait for it here
// We have to check for the sibling checkbox class as the input itself is hidden
actions.waitForElementToShow('.ascribe-form input[name="num_editions-checkbox"] ~ .checkbox', TIMEOUTS.NORMAL);
})
.capture('register work', (actions, find) => {
// The uploader options are only rendered after the user is fetched, so
// we have to wait for it here
// we also have to wait for it here
actions.waitForElementToShow('.file-drag-and-drop-dialog .present-options', TIMEOUTS.NORMAL);
})
.capture('register work filled', (actions, find) => {
@ -177,7 +183,8 @@ gemini.suite('Authenticated', (suite) => {
actions.sendKeys(find('.ascribe-form input[name="date_created"]'), 'date created');
})
.capture('register work filled with editions', (actions, find) => {
actions.click(find('.ascribe-form input[type="checkbox"] ~ .checkbox'));
actions.click(find('.ascribe-form input[name="num_editions-checkbox"] ~ .checkbox'));
// Wait for transition
actions.wait(500);
actions.sendKeys(find('.ascribe-form input[name="num_editions"]'), '50');
});