Skip to content

Commit

Permalink
Fix e2e-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pvannierop committed May 25, 2022
1 parent 4444972 commit 9bb5bc1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ const MUTATION_COUNT_HAMBURGER_ICON = `${MUTATION_COUNT_CHART} [data-test="chart
const MUTATION_COUNT_MENU = `${MUTATION_COUNT_CHART} [data-test="chart-header-hamburger-icon-menu"]`;
const CUSTOM_BINS_MENU = `.modal-dialog`;
const UPDATE_BUTTON = '.btn-sm';
const BIN_SIZE = 'span=Bin size';
const MIN_VALUE = 'span=Min value';
const BIN_SIZE_INPUT = '[data-test=bin-size-input]';
const MIN_VALUE_INPUT = '[data-test=anchorvalue-input]';
const CUSTOM_BINS_TEXTAREA = '[data-test=custom-bins-textarea]';

describe('Custom Bins menu in study view chart header', function() {
beforeEach(() => {
Expand All @@ -40,14 +41,9 @@ describe('Custom Bins menu in study view chart header', function() {

it('generates bins using min and bin size input fields', () => {
selectMenuOption('label=Generate bins');
$(BIN_SIZE)
.$('..')
.$('.input-sm')
.setValue('2');
$(MIN_VALUE)
.$('..')
.$('.input-sm')
.setValue('2');
$(BIN_SIZE_INPUT).waitForExist();
$(BIN_SIZE_INPUT).setValue('2');
$(MIN_VALUE_INPUT).setValue('2');
clickUpdate();
$('body').moveTo();
const res = checkElementWithMouseDisabled(MUTATION_COUNT_CHART);
Expand All @@ -56,7 +52,8 @@ describe('Custom Bins menu in study view chart header', function() {

it('creates custom bins using custom bins input field', () => {
selectMenuOption('label=Custom bins');
$$('.input-sm')[2].setValue('0,10,20,30,40');
$(CUSTOM_BINS_TEXTAREA).waitForExist();
$(CUSTOM_BINS_TEXTAREA).setValue('0,10,20,30,40');
clickUpdate();
$('body').moveTo();
const res = checkElementWithMouseDisabled(MUTATION_COUNT_CHART);
Expand Down
3 changes: 3 additions & 0 deletions src/pages/studyView/charts/barChart/CustomBinsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ export default class CustomBinsModal extends React.Component<
<FormControl
type="text"
style={{ width: 70 }}
data-test={'bin-size-input'}
defaultValue={
this.currentBinsGeneratorConfig.binSize
}
Expand All @@ -245,6 +246,7 @@ export default class CustomBinsModal extends React.Component<
<FormControl
type="text"
style={{ width: 70 }}
data-test={'anchorvalue-input'}
defaultValue={
this.currentBinsGeneratorConfig
.anchorValue
Expand Down Expand Up @@ -274,6 +276,7 @@ export default class CustomBinsModal extends React.Component<
<textarea
style={{ resize: 'none' }}
rows={5}
data-test={'custom-bins-textarea'}
value={this.currentBinsValue}
className="form-control input-sm"
onChange={event =>
Expand Down

0 comments on commit 9bb5bc1

Please sign in to comment.