Skip to content

Commit

Permalink
fix tests and use buttons instead of links
Browse files Browse the repository at this point in the history
  • Loading branch information
Dosant committed Mar 6, 2020
1 parent 05367ec commit 4641454
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import React from 'react';
import { cleanup, fireEvent, render } from '@testing-library/react';
import { cleanup, fireEvent, render } from '@testing-library/react/pure';
import '@testing-library/jest-dom/extend-expect'; // TODO: this should be global
import { TEST_SUBJ_ACTION_FACTORY_ITEM, TEST_SUBJ_SELECTED_ACTION_FACTORY } from './action_wizard';
import {
Expand All @@ -19,8 +19,7 @@ import {
// https://github.com/elastic/kibana/issues/59469
afterEach(cleanup);

// TEMP until https://github.com/elastic/kibana/pull/59445 is merged
test.skip('Pick and configure action', () => {
test('Pick and configure action', () => {
const screen = render(
<Demo actionFactories={[dashboardDrilldownActionFactory, urlDrilldownActionFactory]} />
);
Expand All @@ -47,8 +46,7 @@ test.skip('Pick and configure action', () => {
});
});

// TEMP until https://github.com/elastic/kibana/pull/59445 is merged
test.skip('If only one actions factory is available then actionFactory selection is emitted without user input', () => {
test('If only one actions factory is available then actionFactory selection is emitted without user input', () => {
const screen = render(<Demo actionFactories={[urlDrilldownActionFactory]} />);

// check that no factories are displayed to pick from
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
EuiIcon,
EuiSpacer,
EuiText,
EuiKeyPadMenuItem,
EuiKeyPadMenuItemButton,
} from '@elastic/eui';
import { txtChangeButton } from './i18n';
import './action_wizard.scss';
Expand Down Expand Up @@ -126,6 +126,7 @@ const SelectedActionFactory: React.FC<SelectedActionFactoryProps> = ({
<div
className="auaActionWizard__selectedActionFactoryContainer"
data-test-subj={TEST_SUBJ_SELECTED_ACTION_FACTORY}
data-testid={TEST_SUBJ_SELECTED_ACTION_FACTORY}
>
<header>
<EuiFlexGroup alignItems="center" gutterSize="s">
Expand Down Expand Up @@ -179,15 +180,16 @@ const ActionFactorySelector: React.FC<ActionFactorySelectorProps> = ({
return (
<EuiFlexGroup wrap>
{actionFactories.map(actionFactory => (
<EuiKeyPadMenuItem
<EuiKeyPadMenuItemButton
className="auaActionWizard__actionFactoryItem"
key={actionFactory.type}
label={actionFactory.displayName}
data-testid={TEST_SUBJ_ACTION_FACTORY_ITEM}
data-test-subj={TEST_SUBJ_ACTION_FACTORY_ITEM}
onClick={() => onActionFactorySelected(actionFactory)}
>
{actionFactory.iconType && <EuiIcon type={actionFactory.iconType} size="m" />}
</EuiKeyPadMenuItem>
</EuiKeyPadMenuItemButton>
))}
</EuiFlexGroup>
);
Expand Down

0 comments on commit 4641454

Please sign in to comment.