Skip to content

Commit

Permalink
fix(tool_tip): use mount and focus trigger directly
Browse files Browse the repository at this point in the history
to account for the differences between React versions
  • Loading branch information
weronikaolejniczak committed Nov 28, 2024
1 parent 56ad6ed commit 6dc6d35
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/eui/src/components/tool_tip/tool_tip.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('EuiToolTip', () => {

describe('Escape key', () => {
it('hides the tooltip when rendered by itself', () => {
cy.realMount(
cy.mount(
<EuiToolTip content="Tooltip text here" data-test-subj="tooltip">
<EuiButton data-test-subj="toggleToolTip">Show tooltip</EuiButton>
</EuiToolTip>
Expand All @@ -100,7 +100,7 @@ describe('EuiToolTip', () => {
) : null;
};

cy.realMount(
cy.mount(
<Flyout>
<EuiToolTip content="Tooltip text here" data-test-subj="tool_tip">
<EuiButton data-test-subj="tool_tip_trigger">
Expand All @@ -111,7 +111,7 @@ describe('EuiToolTip', () => {
);
cy.get('[data-test-subj="tool_tip"]').should('not.exist');

cy.repeatRealPress('Tab', 2);
cy.get('[data-test-subj="tool_tip_trigger"]').focus();
cy.get('[data-test-subj="tool_tip"]').should('exist');

cy.realPress('Escape');
Expand All @@ -137,7 +137,7 @@ describe('EuiToolTip', () => {
) : null;
};

cy.realMount(
cy.mount(
<Modal>
<EuiToolTip content="Tooltip text here" data-test-subj="tool_tip">
<EuiButton data-test-subj="tool_tip_trigger">
Expand All @@ -148,7 +148,7 @@ describe('EuiToolTip', () => {
);
cy.get('[data-test-subj="tool_tip"]').should('not.exist');

cy.repeatRealPress('Tab', 2);
cy.get('[data-test-subj="tool_tip_trigger"]').focus();
cy.get('[data-test-subj="tool_tip"]').should('exist');

cy.realPress('Escape');
Expand Down Expand Up @@ -188,7 +188,7 @@ describe('EuiToolTip', () => {
);
};

cy.realMount(
cy.mount(
<Popover>
<EuiToolTip content="Tooltip text here" data-test-subj="tool_tip">
<EuiButton data-test-subj="tool_tip_trigger">
Expand All @@ -199,7 +199,7 @@ describe('EuiToolTip', () => {
);
cy.get('[data-test-subj="tool_tip"]').should('not.exist');

cy.realPress('Tab');
cy.get('[data-test-subj="tool_tip_trigger"]').focus();
cy.get('[data-test-subj="tool_tip"]').should('exist');

cy.realPress('Escape');
Expand Down

0 comments on commit 6dc6d35

Please sign in to comment.