Skip to content

Commit

Permalink
Adjusted use of 'setValue()' based on feedback from @dmlemeshko
Browse files Browse the repository at this point in the history
  • Loading branch information
Heenawter committed Dec 13, 2021
1 parent 3fcd626 commit 4ee8a49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions test/functional/services/common/test_subjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,7 @@ export class TestSubjects extends FtrService {
// call clearValue() and type() on the element that is focused after
// clicking on the testSubject
const input = await this.findService.activeElement();
// if `text` is explicitely set to the empty string, then call clearValueWithKeyboard() rather than clearValue()
if (clearWithKeyboard === true || text === '') {
if (clearWithKeyboard === true) {
await input.clearValueWithKeyboard();
} else {
await input.clearValue();
Expand Down
4 changes: 3 additions & 1 deletion test/functional/services/dashboard/panel_actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,9 @@ export class DashboardPanelActionsService extends FtrService {
} else {
await this.customizePanel();
}
await this.testSubjects.setValue('customEmbeddablePanelTitleInput', customTitle);
await this.testSubjects.setValue('customEmbeddablePanelTitleInput', customTitle, {
clearWithKeyboard: customTitle === '', // if clearing the title using the empty string as the new value, 'clearWithKeyboard' must be true; otherwise, false
});
await this.testSubjects.click('saveNewTitleButton');
}

Expand Down

0 comments on commit 4ee8a49

Please sign in to comment.