Skip to content

Commit

Permalink
[Backport 2.6][#8490][YW] Fix UI unit tests failing for Administratio…
Browse files Browse the repository at this point in the history
…n and EditProviderForm components.
  • Loading branch information
mjoshi0923 committed May 26, 2021
1 parent e215e9d commit 8d85d99
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ describe('EditProviderForm components tests', () => {
const universeListMock = getInitialState();
universeListMock.promiseState = { name: 'SUCCESS', ordinal: 1 };
universeListMock.data = universeListMockData;
const { component } = setup(universeListMock, providerToEdit);
const editProviderMock = getInitialState();
editProviderMock.promiseState = { name: 'SUCCESS', ordinal: 1 };
editProviderMock.data = providerToEdit;
const { component } = setup(universeListMock, editProviderMock);
expect(
component.getByDisplayValue('yb-admin-test-aws_12581bba-b6f7-4a35-8694-060436dcafcc-key')
).toBeInTheDocument();
Expand All @@ -100,7 +103,10 @@ describe('EditProviderForm components tests', () => {
universeListMock.promiseState = { name: 'SUCCESS', ordinal: 1 };
universeListMock.data = universeListMockData;
providerToEdit.uuid = providerToEdit.uuid + 'test';
const { component } = setup(universeListMock, providerToEdit);
const editProviderMock = getInitialState();
editProviderMock.promiseState = { name: 'SUCCESS', ordinal: 1 };
editProviderMock.data = providerToEdit;
const { component } = setup(universeListMock, editProviderMock);
expect(
component.getByDisplayValue('yb-admin-test-aws_12581bba-b6f7-4a35-8694-060436dcafcc-key')
).toBeInTheDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class YBTabsWithLinksPanel extends Component {

queryTabHandler = () => {
const { location, children } = this.props;
const locationTabKey = location.query.tab;
const locationTabKey = location.query?.tab;
if (isDefinedNotNull(locationTabKey)) {
return children.some((item) => {
return item.props.eventKey.indexOf(locationTabKey) >= 0 && !item.props.disabled;
Expand Down Expand Up @@ -66,7 +66,7 @@ class YBTabsWithLinksPanel extends Component {
className={this.props.className}
>
<div>
<Nav bsStyle="tabs" className="nav nav-tabs">
<Nav bsStyle="tabs" className="nav nav-tabs" role="tablist">
{links}
</Nav>
<Tab.Content animation>{this.props.children}</Tab.Content>
Expand Down

0 comments on commit 8d85d99

Please sign in to comment.