Skip to content

Commit

Permalink
chore(*): delete method get private property
Browse files Browse the repository at this point in the history
  • Loading branch information
hqmaker committed Mar 11, 2020
1 parent 244cf91 commit 63de084
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/calendar-input/calendar-input.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe('calendar-input', () => {

it('should focus input on after `focus` call', () => {
const calendarInput = mount<CalendarInput>(<CalendarInput />);
const focusTarget = calendarInput.instance().getCustomCalendarTarget();
const focusTarget = (calendarInput.instance() as any).customCalendarTarget;

jest.spyOn(focusTarget, 'focus');

Expand All @@ -89,7 +89,7 @@ describe('calendar-input', () => {

it('should blur input on after `blur` call', () => {
const calendarInput = mount<CalendarInput>(<CalendarInput />);
const focusTarget = calendarInput.instance().getCustomCalendarTarget();
const focusTarget = (calendarInput.instance() as any).customCalendarTarget;

jest.spyOn(focusTarget, 'blur');

Expand Down Expand Up @@ -282,7 +282,7 @@ describe('calendar-input', () => {

it('should focus on input after escape key was pressed in calendar', () => {
const wrapper = mount<CalendarInput>(<CalendarInput />);
const calendarTarget = wrapper.instance().getCustomCalendarTarget();
const calendarTarget = (wrapper.instance() as any).customCalendarTarget;
const calendarNode = wrapper.find('.calendar');

jest.spyOn(calendarTarget, 'focus');
Expand All @@ -294,7 +294,7 @@ describe('calendar-input', () => {

it('should focus on input after calendar icon was clicked', () => {
const wrapper = mount<CalendarInput>(<CalendarInput />);
const calendarTarget = wrapper.instance().getCustomCalendarTarget();
const calendarTarget = (wrapper.instance() as any).customCalendarTarget;

jest.spyOn(calendarTarget, 'focus');
const iconNode = wrapper.find('.icon');
Expand Down
4 changes: 0 additions & 4 deletions src/calendar-input/calendar-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -752,10 +752,6 @@ export class CalendarInput extends React.Component<CalendarInputProps> {
this.timeoutId = null;
}, 0);
}

public getCustomCalendarTarget() {
return this.customCalendarTarget;
}
}

class ThemedCalendarInput extends CalendarInput {}
Expand Down
4 changes: 3 additions & 1 deletion src/checkbox-group/checkbox-group.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,16 @@ describe('checkbox-group', () => {
});

it('should focus first child checkbox-button on public focus method', () => {

const checkboxGroup = mount<CheckBoxGroup>(
<CheckBoxGroup>
<CheckBox />
<CheckBox />
<CheckBox />
</CheckBoxGroup>
);
const firstCheckboxInstance = checkboxGroup.instance().getCheckboxes()[0];

const firstCheckboxInstance = (checkboxGroup.instance() as any).checkboxes[0];

jest.spyOn(firstCheckboxInstance, 'focus');
checkboxGroup.instance().focus();
Expand Down
5 changes: 0 additions & 5 deletions src/checkbox-group/checkbox-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,6 @@ export class CheckBoxGroup extends React.PureComponent<CheckBoxGroupProps> {
this.checkboxes[0].focus();
}
}

public getCheckboxes() {
return this.checkboxes;
}

/**
* Убирает фокус с группы чекбокс-кнопок.
*/
Expand Down

0 comments on commit 63de084

Please sign in to comment.