Skip to content

Commit

Permalink
Disable orientation if ticklabels are off
Browse files Browse the repository at this point in the history
  • Loading branch information
stratoula committed Jul 26, 2021
1 parent 075ee90 commit aa1b645
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ describe('Axes Settings', () => {
expect(props.setOrientation).toHaveBeenCalled();
});

it('should disable the orientation group if the tickLabels are set to not visible', () => {
const component = shallow(<AxisSettingsPopover {...props} areTickLabelsVisible={false} />);
expect(
component.find('[data-test-subj="lnsXY_axisOrientation_groups"]').prop('isDisabled')
).toEqual(true);
});

it('hides the endzone visibility flag if no setter is passed in', () => {
const component = shallow(<AxisSettingsPopover {...props} />);
expect(component.find('[data-test-subj="lnsshowEndzones"]').length).toBe(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ export const AxisSettingsPopover: React.FunctionComponent<AxisSettingsPopoverPro
})}
data-test-subj="lnsXY_axisOrientation_groups"
name="axisOrientation"
isDisabled={!areTickLabelsVisible}
buttonSize="compressed"
options={axisOrientationOptions}
idSelected={axisOrientationOptions.find(({ value }) => value === orientation)!.id}
Expand Down

0 comments on commit aa1b645

Please sign in to comment.