From 01b258334a8ce60768d71f70a725c1207640488e Mon Sep 17 00:00:00 2001 From: Brett Sun Date: Fri, 5 Feb 2016 14:21:31 +0100 Subject: [PATCH] Fix register work visual test --- js/components/ascribe_forms/property.js | 10 +++++----- test/gemini/tests/main/authenticated.js | 11 +++++++++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/js/components/ascribe_forms/property.js b/js/components/ascribe_forms/property.js index 6d46a9d3..16238802 100644 --- a/js/components/ascribe_forms/property.js +++ b/js/components/ascribe_forms/property.js @@ -294,18 +294,18 @@ const Property = React.createClass({ }, getCheckbox() { - const { checkboxLabel } = this.props; + const { checkboxLabel, name } = this.props; - if(checkboxLabel) { + if (checkboxLabel) { return (
+ onChange={this.handleCheckboxToggle} + type="checkbox" /> {' ' + checkboxLabel}
); diff --git a/test/gemini/tests/main/authenticated.js b/test/gemini/tests/main/authenticated.js index 7adfe16d..95eb62bd 100644 --- a/test/gemini/tests/main/authenticated.js +++ b/test/gemini/tests/main/authenticated.js @@ -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'); });