Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
Updated wdio tests with screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
adavijit committed May 24, 2024
1 parent 31dc421 commit 1ea2582
Show file tree
Hide file tree
Showing 20 changed files with 33 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/terra-form-select/src/search/Frame.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ class Frame extends React.Component {

this.setState({ isFocused: false, focusedByTouch: false });

if (this.state.hasSearchChanged) {
this.setState({
searchValue: this.state.searchValue.trim(),

Check failure on line 236 in packages/terra-form-select/src/search/Frame.jsx

View workflow job for this annotation

GitHub Actions / build

Use callback in setState when referencing the previous state
});
}

this.closeDropdown();

if (this.props.onBlur) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions packages/terra-form-select/tests/wdio/select-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1795,6 +1795,33 @@ Terra.describeViewports('Select', ['tiny'], () => {

after(() => $('#root').click());
});

describe('should retain input value on fucusing another component', () => {
it('retain input and focus using tab key', () => {
$('[data-terra-select]').click();
const input = $('[data-terra-select-combobox] input');
input.setValue('Test');

// Pressing Tab key twice to focus the body
browser.keys('Tab');
browser.keys('Tab');

expect($('body')).toBeFocused();
expect(input).toHaveValue('Test');
});

it('should retain input value and focus body when body is clicked', () => {
const input = $('[data-terra-select-combobox] input');

$('[data-terra-select]').click();
input.setValue('Test');

$('body').click();

expect($('body')).toBeFocused();
expect(input).toHaveValue('Test');
});
});
});

describe('Search Variant - controlled', () => {
Expand Down

0 comments on commit 1ea2582

Please sign in to comment.