Skip to content

Conversation

@MidnightCoder06
Copy link
Contributor

@adobe-bot
Copy link

Build successful! View the storybook

@MidnightCoder06 MidnightCoder06 changed the title [WIP] Additional TooltipTrigger Tests Additional TooltipTrigger Tests Feb 18, 2020
@adobe-bot
Copy link

Build successful! View the storybook

@adobe-bot
Copy link

Build successful! View the storybook

describe('DOMPropsResponder', function () {
afterEach(cleanup);

it('should handle hover events on nested hoverable children', function () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this name, I don't see any nested Hoverable components. Should I be seeing any more than the one?

import {DOMPropsResponder, Hoverable} from '../';
import React from 'react';

describe('DOMPropsResponder', function () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand how this is a DOMPropsResponder test suite, nothing in here references it other than it being the wrapping component. Is there anything we should be checking on that component itself during our tests?
Otherwise it just looks like the test suite directly below about Hoverable

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to the above ^

</Provider>
);

expect(() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this removed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this because of this comment?

Still not sure why the closing actions aren't being registered in tooltiptrigger tests file 🤔 so I deleted them instead of doing the id checking hack. Technically this is handled with the tooltip manager tests file anyway 🤷‍♂

Lets try to figure out why, I have some time today, maybe we can look at it together after lunch?

Copy link
Contributor Author

@MidnightCoder06 MidnightCoder06 Feb 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tried adding it back and it caused a failure. Not sure why, it was there for quite some time and I don't see what has changed.

describe('click related tests', function () {

it('triggered by click event', async function () {
it('a click event can open the tooltip', async function () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the difference between this test and the one above it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the first one I am checking Id's (line 59 and and 60). In the one you referenced here I am not

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, so why do we need this test, what is the value that this test adds over the previous one?

expect(tooltipManager.hoverHideTimeout).toBeNull();

// run past first tooltips show timer
jest.advanceTimersByTime(150);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think there should be a check for something right after this line?
originally I'd checked
expect(tooltipManager.visibleTooltips).toBeNull();
is there a reason for not checking this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the line added?

@@ -0,0 +1,137 @@
import {TooltipManager} from '../';

describe('TooltipManager', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming that the remainder of the tests will be added in https://jira.corp.adobe.com/browse/RSP-1471
Can you please make notes of places that you diverged from the tests outlined there vs here and why?

Copy link
Contributor Author

@MidnightCoder06 MidnightCoder06 Feb 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a toast container, not a tooltip ticket?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, whoops, copy pasta mistake https://jira.corp.adobe.com/browse/RSP-1367

import {DOMPropsResponder, Hoverable} from '../';
import React from 'react';

describe('DOMPropsResponder', function () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to the above ^

Comment on lines 11 to 17
<DOMPropsResponder>
<div>
<Hoverable onHover={onHover}>
<button>Button</button>
</Hoverable>
</div>
</DOMPropsResponder>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I think I understand what you are trying to test here now, these are like the PressResponder tests yeah? You should probably move the onHover and ref props to DOMPropsResponder so it actually tests that the DOMPropsResponder context is being set up properly and being consumed by Hoverable.

<DOMPropsResponder onHover={onHover}>
....

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

Copy link
Member

@LFDanLu LFDanLu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov
Copy link

codecov bot commented Feb 28, 2020

Codecov Report

Merging #193 into master will increase coverage by 1.1%.
The diff coverage is 73.33%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #193     +/-   ##
=========================================
+ Coverage   69.55%   70.65%   +1.1%     
=========================================
  Files         206      206             
  Lines        3961     3963      +2     
  Branches      839      842      +3     
=========================================
+ Hits         2755     2800     +45     
+ Misses        625      589     -36     
+ Partials      581      574      -7
Impacted Files Coverage Δ
...s/@react-spectrum/menu-trigger/src/MenuTrigger.tsx 93.33% <ø> (ø) ⬆️
packages/@react-aria/menu-trigger/src/useMenu.ts 72.72% <ø> (ø) ⬆️
...ckages/@react-aria/menu-trigger/src/useMenuItem.ts 54.16% <ø> (ø) ⬆️
packages/@react-spectrum/menu-trigger/src/Menu.tsx 85.71% <ø> (+0.52%) ⬆️
...ckages/@react-spectrum/menu-trigger/src/context.ts 100% <ø> (ø) ⬆️
...ges/@react-aria/menu-trigger/src/useMenuTrigger.ts 91.3% <100%> (+0.39%) ⬆️
...react-stately/collections/src/CollectionBuilder.ts 44.44% <50%> (+0.09%) ⬆️
...eact-aria/selection/src/useSelectableCollection.ts 52% <75%> (+3.13%) ⬆️
...ges/@react-spectrum/tooltip/src/TooltipTrigger.tsx 92.85% <0%> (+7.14%) ⬆️
...kages/@react-aria/tooltip/src/useTooltipTrigger.ts 88.46% <0%> (+11.53%) ⬆️
... and 5 more

@adobe-bot
Copy link

Build successful! 🎉

@MidnightCoder06 MidnightCoder06 merged commit 451be52 into master Feb 28, 2020
@MidnightCoder06 MidnightCoder06 deleted the tooltipTriggerTests branch February 28, 2020 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants